Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Fojtl committed Oct 22, 2021
0 parents commit 72f36fc
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
16 changes: 16 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "polyweb-cz/attachment-sdk",
"description": "Attachment development kit",
"version": "0.0.1",
"require": {
"php": ">=8.0"
},
"autoload": {
"psr-4": {
"PolyWeb\\Attachment\\Sdk\\": "src"
}
},
"autoload-dev": {
"classmap": ["src/"]
}
}
17 changes: 17 additions & 0 deletions src/APackage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php


namespace PolyWeb\Attachment\Sdk;


abstract class APackage implements IPackage
{
public function getAttachmentPath(string $name): string
{
$path = $this->getWorkDirectory() . '/' . $name;
if (!file_exists($path)) {
throw new \Exception('Attachment "' . $name . '" does not exist in "' . $this->getWorkDirectory() . '"');
}
return $path;
}
}
16 changes: 16 additions & 0 deletions src/IPackage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php


namespace PolyWeb\Attachment\Sdk;


interface IPackage
{
public function getWorkDirectory(): string;

public function getAttachmentPrefix(): string;

public function getAttachmentModule(): string;

public function getAttachmentPath(string $name): string;
}

0 comments on commit 72f36fc

Please sign in to comment.