Skip to content

Commit

Permalink
View overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed Feb 7, 2023
1 parent 6d62483 commit 9e4f7c8
Show file tree
Hide file tree
Showing 13 changed files with 121 additions and 293 deletions.
7 changes: 1 addition & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,9 @@
"phpstan/phpstan": "^1.6",
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
"ICanBoogie\\Binding\\View\\": "lib"
}
},
"autoload-dev": {
"psr-4": {
"ICanBoogie\\Binding\\View\\": "tests/lib"
"Test\\ICanBoogie\\Binding\\View\\": "tests/lib"
},
"classmap": [
"tests/Application.php"
Expand Down
11 changes: 0 additions & 11 deletions config/prototype.php

This file was deleted.

9 changes: 9 additions & 0 deletions config/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
_defaults:
autowire: true

ICanBoogie\View\LayoutResolver:
class: ICanBoogie\View\LayoutResolver\Basic

ICanBoogie\View\ViewProvider:
class: ICanBoogie\View\ViewProvider\Basic
61 changes: 0 additions & 61 deletions lib/Hooks.php

This file was deleted.

7 changes: 7 additions & 0 deletions tests/app/all/config/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
_defaults:
autowire: true

Test\ICanBoogie\Binding\View\Acme\ArticleController:
public: true
shared: false
11 changes: 11 additions & 0 deletions tests/lib/Acme/Article.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Test\ICanBoogie\Binding\View\Acme;

final class Article
{
public function __construct(
public readonly string $title
) {
}
}
42 changes: 42 additions & 0 deletions tests/lib/Acme/ArticleController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/*
* This file is part of the ICanBoogie package.
*
* (c) Olivier Laviale <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Test\ICanBoogie\Binding\View\Acme;

use ICanBoogie\Routing\Controller\ActionTrait;
use ICanBoogie\Routing\ControllerAbstract;
use ICanBoogie\View\View;
use ICanBoogie\View\ViewProvider;
use ICanBoogie\View\ViewTrait;

final class ArticleController extends ControllerAbstract
{
/**
* @uses show
*/
use ActionTrait;
use ViewTrait;

public function __construct(
private readonly ViewProvider $view_provider
) {
}

private function show(): View
{
$article = new Article("Article A");

$this->response->headers->cache_control = 'public';
$this->response->expires = '+3 hour';

return $this->view($article);
}
}
84 changes: 0 additions & 84 deletions tests/lib/ControllerBindingsTest.php

This file was deleted.

20 changes: 0 additions & 20 deletions tests/lib/ControllerBindingsTest/BoundController.php

This file was deleted.

25 changes: 0 additions & 25 deletions tests/lib/ControllerBindingsTest/BoundControllerWithLayout.php

This file was deleted.

25 changes: 0 additions & 25 deletions tests/lib/ControllerBindingsTest/BoundControllerWithTemplate.php

This file was deleted.

61 changes: 0 additions & 61 deletions tests/lib/HooksTest.php

This file was deleted.

Loading

0 comments on commit 9e4f7c8

Please sign in to comment.