Skip to content

Commit

Permalink
Fix compatibility issues from v0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Dec 8, 2023
1 parent 5e77433 commit d001c1f
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 28 deletions.
3 changes: 1 addition & 2 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
/**
* Application
*
* Integrates all specified components into the application.
* NOTE: To be removed in v1.0.0. Use \System instead.
* NOTE: To be removed in v1.0.0. Use "System" instead.
*
* @package Slytherin
* @author Rougin Gutib <rougingutib@gmail.com>
Expand Down
29 changes: 23 additions & 6 deletions src/Component/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
/**
* Component Collection
*
* Contains all the required components for Slytherin.
* NOTE: To be removed in v1.0.0. Use "Integration" instead.
*
* @package Slytherin
Expand Down Expand Up @@ -50,6 +49,28 @@ public function setContainer(ContainerInterface $container)
return $this;
}

/**
* Gets an instance of the dependency injector.
* NOTE: To be removed in v1.0.0. Use "getContainer" instead.
*
* @return \Rougin\Slytherin\IoC\ContainerInterface
*/
public function getDependencyInjector()

Check warning on line 58 in src/Component/Collection.php

View check run for this annotation

Codecov / codecov/patch

src/Component/Collection.php#L58

Added line #L58 was not covered by tests
{
return $this->getContainer();

Check warning on line 60 in src/Component/Collection.php

View check run for this annotation

Codecov / codecov/patch

src/Component/Collection.php#L60

Added line #L60 was not covered by tests
}

/**
* Sets the dependency injector.
* NOTE: To be removed in v1.0.0. Use "setContainer" instead.
*
* @param \Rougin\Slytherin\IoC\ContainerInterface $injector
*/
public function setDependencyInjector(ContainerInterface $injector)

Check warning on line 69 in src/Component/Collection.php

View check run for this annotation

Codecov / codecov/patch

src/Component/Collection.php#L69

Added line #L69 was not covered by tests
{
return $this->setContainer($injector);

Check warning on line 71 in src/Component/Collection.php

View check run for this annotation

Codecov / codecov/patch

src/Component/Collection.php#L71

Added line #L71 was not covered by tests
}

/**
* Gets the dispatcher.
*
Expand Down Expand Up @@ -130,11 +151,7 @@ public function setErrorHandler(ErrorHandlerInterface $errorHandler)
*/
public function getHttp()
{
$request = $this->get(System::SERVER_REQUEST);

$response = $this->get(System::RESPONSE);

return array($request, $response);
return array($this->getHttpRequest(), $this->getHttpResponse());
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/ComponentCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
/**
* Component Collection
*
* Contains all the required components for Slytherin.
* NOTE: To be removed in v1.0.0. Use "Component\Collection" instead.
* NOTE: To be removed in v1.0.0. Use "Components" instead.
*
* @package Slytherin
* @author Rougin Gutib <rougingutib@gmail.com>
Expand Down
1 change: 0 additions & 1 deletion src/Components.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/**
* Component Collection
*
* Contains all the required components for Slytherin.
* NOTE: To be removed in v1.0.0. Use "Component\Collection" instead.
*
* @package Slytherin
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Configuration
*
* Serves as a storage for configuration data.
* NOTE: To be removed in v1.0.0. Use "Integration/Configuration" instead.
*
* @package Slytherin
* @author Rougin Gutib <rougingutib@gmail.com>
Expand Down
3 changes: 1 addition & 2 deletions src/ErrorHandler/ErrorHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
/**
* Error Handler Interface
*
* An interface for handling third party debuggers.
* NOTE: To be removed in v1.0.0. Use "ErrorHandlerIntegration" instead.
* NOTE: To be removed in v1.0.0. Use "Debug\DebuggerInterface" instead.
*
* @package Slytherin
* @author Rougin Gutib <rougingutib@gmail.com>
Expand Down
7 changes: 2 additions & 5 deletions src/ErrorHandler/Whoops.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

namespace Rougin\Slytherin\ErrorHandler;

use Rougin\Slytherin\Debug\Whoops\Debugger;
use Rougin\Slytherin\Debug\Debugger;

/**
* Debugger
*
* A simple implementation of a debugger built on top of Filipe Dobreira's
* Whoops. NOTE: To be removed in v1.0.0. Use "ErrorHandlerIntegration" instead.
*
* http://filp.github.io/whoops
* NOTE: To be removed in v1.0.0. Use "Debug\Debugger" instead.
*
* @package Slytherin
* @author Rougin Gutib <rougingutib@gmail.com>
Expand Down
15 changes: 15 additions & 0 deletions src/IoC/Auryn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Rougin\Slytherin\IoC;

/**
* Auryn Container
*
* NOTE: To be removed in v1.0.0. Use "AurynContainer" instead.
*
* @package Slytherin
* @author Rougin Gutib <rougingutib@gmail.com>
*/
class Auryn extends AurynContainer
{
}
4 changes: 0 additions & 4 deletions src/IoC/Auryn/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
/**
* Auryn Container
*
* A simple implementation of a container that is built on top of
* Daniel Lowrey's Auryn Inversion Of Control (IoC) Dependency Injector.
* NOTE: To be removed in v1.0.0. Use "Container\AurynContainer" instead.
*
* https://github.com/rdlowrey/auryn
*
* @package Slytherin
* @author Rougin Gutib <rougingutib@gmail.com>
*/
Expand Down
6 changes: 1 addition & 5 deletions src/IoC/AurynContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
/**
* Auryn Container
*
* A simple implementation of a container that is built on top of
* Daniel Lowrey's Auryn Inversion Of Control (IoC) Dependency Injector.
* NOTE: To be removed in v1.0.0. Use "Container\AurynContainer" instead.
*
* https://github.com/rdlowrey/auryn
* NOTE: To be removed in v1.0.0. Use "Auryn\Container" instead.
*
* @package Slytherin
* @author Rougin Gutib <rougingutib@gmail.com>
Expand Down
17 changes: 17 additions & 0 deletions src/IoC/ContainerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Rougin\Slytherin\IoC;

use Rougin\Slytherin\Container\ContainerInterface as Slytherin;

/**
* Dependency Injection Container Interface
*
* NOTE: To be removed in v1.0.0. Use "Container\ContainerInterface" instead.
*
* @package Slytherin
* @author Rougin Gutib <rougingutib@gmail.com>
*/
interface ContainerInterface extends Slytherin
{
}
8 changes: 8 additions & 0 deletions src/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
use Rougin\Slytherin\Integration\ConfigurationInterface;
use Rougin\Slytherin\System\Handler;

/**
* System Application
*
* Integrates all specified components into the application.
*
* @package Slytherin
* @author Rougin Gutib <rougingutib@gmail.com>
*/
class System
{
const CONTAINER = 'Psr\Container\ContainerInterface';
Expand Down

0 comments on commit d001c1f

Please sign in to comment.