Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidPetrasek committed Feb 28, 2024
1 parent 73c069b commit 85033ad
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 139 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "psys/utils",
"description": "General purpose set of utilities for web apps",
"description": "General purpose set of utilities for web app development",
"type": "library",
"license": "MIT",
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions src/FileUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function pathRemoveExtension ($path)
return substr($path, 0, -$pozicePripony);
}

public function vytvoritNahled ($soubor, $adresar)
public function createThumbnail ($soubor, $adresar)
{
if ($soubor['mimeType'] !== 'application/pdf' && $soubor['mimeType'] !== 'image/jpeg' && $soubor['mimeType'] !== 'image/png') {return;}

Expand All @@ -54,7 +54,7 @@ public function vytvoritNahled ($soubor, $adresar)

$imagick->writeImage($filenameNoExt.'_nahled.jpg');
}
catch (Exception $e)
catch (\Exception $e)
{
$this->vLogger->error("Výjimka Imagick při vytváření náhledu (u souboru $souborCesta)", [$exception->getMessage()]);
}
Expand Down
3 changes: 3 additions & 0 deletions src/Result.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace Utils;

/**
* Used for returning a result of a function or method.
*/
class Result
{
private bool $status;
Expand Down
2 changes: 1 addition & 1 deletion src/Cr/Kraj.php → src/Territory/CzechRepublic/Kraj.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Utils\Cr;
namespace Territory\CzechRepublic;


enum Kraj :int
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Utils\Cr;
namespace Territory\CzechRepublic;


class KrajOkres
Expand Down
2 changes: 1 addition & 1 deletion src/Cr/Okres.php → src/Territory/CzechRepublic/Okres.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Utils\Cr;
namespace Territory\CzechRepublic;


enum Okres :string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Utils\Cr;
namespace Territory\CzechRepublic;


enum PrahaSpravniObvod :int
Expand Down
11 changes: 11 additions & 0 deletions src/User/AccountStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
namespace Utils\User;


enum AccountStatus :int
{
case REGISTRATION_INCOMPLETE = 1;
case ACTIVE = 2;
case DISABLED = 3;
}
?>
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?php
namespace Utils\Uzivatel\FyzickaOsoba;
namespace Utils\User\NaturalPerson;


enum Pohlavi :int
enum Gender :int
{
case MUZ = 1;
case ZENA = 2;
case MAN = 1;
case FEMALE = 2;

static function fromString ($string) : ?self
{
switch ($string)
{
case 'muž':
return Pohlavi::MUZ;
case 'man':
return Gender::MAN;
break;
case 'žena':
return Pohlavi::ZENA;
case 'female':
return Gender::FEMALE;
break;

default:
Expand Down
103 changes: 0 additions & 103 deletions src/Uzivatel/PravnickaOsoba/ZamestnanciPocetRozpeti.php

This file was deleted.

21 changes: 0 additions & 21 deletions src/Uzivatel/UcetStav.php

This file was deleted.

0 comments on commit 85033ad

Please sign in to comment.