Skip to content

Commit a769bcc

Browse files
committed
Update
- Licensing - Improve interfaces
1 parent 47d43ab commit a769bcc

13 files changed

+156
-154
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 FloatPHP
3+
Copyright (c) 2024 FloatPHP
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# FloatPHP (Interfaces)
22

3-
<img src="https://www.floatphp.com/assets/img/floatphp.png" width="100" alt="Micro PHP framework">
3+
<img src="https://floatphp.com/assets/img/floatphp.png" width="100" alt="Micro PHP framework">
44

55
FloatPHP **Interfaces Components**.
6+
This components defines framwork components behavior.
67

78
## ⚡ Installing:
89

composer.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
{
22
"name": "floatphp/interfaces",
3-
"version" : "1.0.2",
3+
"version" : "1.1.0",
44
"type": "library",
55
"description": "FloatPHP Interfaces Components",
66
"keywords": ["php","micro-framework","framework","PSR","ORM","jakiboy"],
7-
"homepage": "https://www.floatphp.com/",
7+
"homepage": "https://floatphp.com",
88
"license": "MIT",
99
"authors": [
1010
{
1111
"name": "Jihad Sinnaour",
1212
"email": "[email protected]",
1313
"role": "Founder"
14-
},
15-
{
16-
"name": "Softgine",
17-
"email": "[email protected]",
18-
"role": "Developer"
1914
}
2015
],
2116
"require": {

src/Classes/LoggerInterface.php

Lines changed: 67 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22
/**
3-
* @author : JIHAD SINNAOUR
3+
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Classes Component
6-
* @version : 1.0.2
6+
* @version : 1.1.0
77
* @category : PHP framework
8-
* @copyright : (c) 2017 - 2021 JIHAD SINNAOUR <[email protected]>
9-
* @link : https://www.floatphp.com
8+
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
9+
* @link : https://floatphp.com
1010
* @license : MIT
1111
*
1212
* This file if a part of FloatPHP Framework.
@@ -17,43 +17,95 @@
1717
interface LoggerInterface
1818
{
1919
/**
20+
* Init logger.
21+
*
2022
* @param string $path
2123
* @param string $filename
2224
* @param string $extension
2325
*/
24-
function __construct($path, $filename, $extension);
26+
function __construct(string $path = '/', string $filename = 'debug', string $extension = 'log');
2527

2628
/**
29+
* Set log path.
30+
*
31+
* @param string $path
32+
* @return object
33+
*/
34+
function setPath(string $path) : self;
35+
36+
/**
37+
* Get log path.
38+
*
39+
* @return string
40+
*/
41+
function getPath() : string;
42+
43+
/**
44+
* Set log filename.
45+
*
46+
* @param string $filename
47+
* @return object
48+
*/
49+
function setFilename(string $filename) : self;
50+
51+
/**
52+
* Set log extension.
53+
*
54+
* @param string $extension
55+
* @return object
56+
*/
57+
function setExtension(string $extension) : self;
58+
59+
/**
60+
* Log debug message.
61+
*
62+
* @param mixed $message
63+
* @param bool $isArray
64+
* @return bool
65+
*/
66+
function debug($message, bool $isArray = false) : bool;
67+
68+
/**
69+
* Log error message.
70+
*
2771
* @param string $message
28-
* @return void
72+
* @return bool
2973
*/
30-
function error($message = '');
74+
function error(string $message) : bool;
3175

3276
/**
77+
* Log warning message.
78+
*
3379
* @param string $message
34-
* @return void
80+
* @return bool
3581
*/
36-
function warning($message = '');
82+
function warning(string $message) : bool;
3783

3884
/**
85+
* Log info message.
86+
*
3987
* @param string $message
40-
* @return void
88+
* @return bool
4189
*/
42-
function info($message = '');
90+
function info(string $message) : bool;
4391

4492
/**
93+
* Log custom message.
94+
*
4595
* @param string $message
4696
* @param string $type
47-
* @return void
97+
* @return bool
4898
*/
49-
function custom($message = '', $type = 'custom');
99+
function custom(string $message, string $type = 'custom') : bool;
50100

51101
/**
102+
* Log natif error.
103+
*
52104
* @param string $message
53105
* @param int $type 0
54106
* @param string $path
55107
* @param string $headers
56-
* @return void
108+
* @return bool
57109
*/
58-
function log($message = '', $type = 0, $path = null, $headers = null);
110+
function log(string $message, int $type = 0, ?string $path = null, ?string $headers = null) : bool;
59111
}

src/Classes/RouterInterface.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22
/**
3-
* @author : JIHAD SINNAOUR
3+
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Classes Component
6-
* @version : 1.0.2
6+
* @version : 1.1.0
77
* @category : PHP framework
8-
* @copyright : (c) 2017 - 2021 JIHAD SINNAOUR <[email protected]>
9-
* @link : https://www.floatphp.com
8+
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
9+
* @link : https://floatphp.com
1010
* @license : MIT
1111
*
1212
* This file if a part of FloatPHP Framework.
@@ -24,7 +24,6 @@ interface RouterInterface
2424
function __construct($routes = [], $basePath = '', $matchTypes = []);
2525

2626
/**
27-
* @param void
2827
* @return array
2928
*/
3029
function getRoutes();

src/Helpers/CacheInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22
/**
3-
* @author : JIHAD SINNAOUR
3+
* @author : Jakiboy
44
* @package : FloatPHP
5-
* @subpackage : Interfaces Kernel Component
6-
* @version : 1.0.2
5+
* @subpackage : Interfaces Helpers Component
6+
* @version : 1.1.0
77
* @category : PHP framework
8-
* @copyright : (c) 2017 - 2021 JIHAD SINNAOUR <[email protected]>
9-
* @link : https://www.floatphp.com
8+
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
9+
* @link : https://floatphp.com
1010
* @license : MIT
1111
*
1212
* This file if a part of FloatPHP Framework.
1313
*/
1414

1515
namespace FloatPHP\Interfaces\Helpers;
1616

17-
interface CacheInterface {}
17+
interface CacheInterface {}

src/Kernel/ApiInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22
/**
3-
* @author : JIHAD SINNAOUR
3+
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Kernel Component
6-
* @version : 1.0.2
6+
* @version : 1.1.0
77
* @category : PHP framework
8-
* @copyright : (c) 2017 - 2021 JIHAD SINNAOUR <[email protected]>
9-
* @link : https://www.floatphp.com
8+
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
9+
* @link : https://floatphp.com
1010
* @license : MIT
1111
*
1212
* This file if a part of FloatPHP Framework.
1313
*/
1414

1515
namespace FloatPHP\Interfaces\Kernel;
1616

17-
interface ApiInterface {}
17+
interface ApiInterface {}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22
/**
3-
* @author : JIHAD SINNAOUR
3+
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Kernel Component
6-
* @version : 1.0.2
6+
* @version : 1.1.0
77
* @category : PHP framework
8-
* @copyright : (c) 2017 - 2021 JIHAD SINNAOUR <[email protected]>
9-
* @link : https://www.floatphp.com
8+
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
9+
* @link : https://floatphp.com
1010
* @license : MIT
1111
*
1212
* This file if a part of FloatPHP Framework.
1313
*/
1414

1515
namespace FloatPHP\Interfaces\Kernel;
1616

17-
interface AuthMiddlewareInterface {}
17+
interface AuthMiddlewareInterface {}

src/Kernel/AuthenticationInterface.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22
/**
3-
* @author : JIHAD SINNAOUR
3+
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Kernel Component
6-
* @version : 1.0.2
6+
* @version : 1.1.0
77
* @category : PHP framework
8-
* @copyright : (c) 2017 - 2021 JIHAD SINNAOUR <[email protected]>
9-
* @link : https://www.floatphp.com
8+
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
9+
* @link : https://floatphp.com
1010
* @license : MIT
1111
*
1212
* This file if a part of FloatPHP Framework.
@@ -17,19 +17,18 @@
1717
interface AuthenticationInterface
1818
{
1919
/**
20-
* @param string $username
20+
* @param string $user
2121
* @return mixed
2222
*/
23-
function getUser(string $username);
23+
function getUser(string $user);
2424

2525
/**
26-
* @param string $username
26+
* @param string $user
2727
* @return bool
2828
*/
29-
function hasSecret(string $username) : bool;
29+
function hasSecret(string $user) : bool;
3030

3131
/**
32-
* @param void
3332
* @return string
3433
*/
3534
function getKey() : string;

src/Kernel/BackendInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22
/**
3-
* @author : JIHAD SINNAOUR
3+
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Kernel Component
6-
* @version : 1.0.2
6+
* @version : 1.1.0
77
* @category : PHP framework
8-
* @copyright : (c) 2017 - 2021 JIHAD SINNAOUR <[email protected]>
9-
* @link : https://www.floatphp.com
8+
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
9+
* @link : https://floatphp.com
1010
* @license : MIT
1111
*
1212
* This file if a part of FloatPHP Framework.
1313
*/
1414

1515
namespace FloatPHP\Interfaces\Kernel;
1616

17-
interface BackendInterface {}
17+
interface BackendInterface {}

0 commit comments

Comments
 (0)