Skip to content

Commit

Permalink
Symfony 5 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain Guerrero committed Jul 3, 2023
1 parent 6004901 commit 3292e64
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 155 deletions.
9 changes: 3 additions & 6 deletions Annotations/Driver/Yaml.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
namespace ACSEO\FastShowGeneratorBundle\Annotations\Driver;

use Symfony\Component\Yaml\Parser;
use Symfony\Component\Yaml\Exception\ParseException;

class Yaml extends Driver
{
private $reader;

public function __construct($kernel)
{
$this->kernel = $kernel;
Expand Down Expand Up @@ -41,14 +38,14 @@ public function getShowableData()
* @return array the parsed YAML file
*/
private function getYamlContent($instance)
{
{
$content = false;

if ($yamlFile = $this->locateYamlFile($instance)) {
$yamlParser = new Parser();
$content = $yamlParser->parse(file_get_contents($yamlFile));
}

return $content;
}

Expand Down Expand Up @@ -96,5 +93,5 @@ private function getBundleNameForClass($rootEntityName) {
}

return $bundleName;
}
}
}
60 changes: 0 additions & 60 deletions Command/GenerateFastShowCommand.php

This file was deleted.

4 changes: 2 additions & 2 deletions DependencyInjection/ACSEOFastShowGeneratorExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace ACSEO\FastShowGeneratorBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

/**
* This is the class that loads and manages your bundle configuration
Expand Down
3 changes: 1 addition & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('acseo_fast_show_generator');
$treeBuilder = new TreeBuilder('acseo_fast_show_generator');

// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
Expand Down
53 changes: 0 additions & 53 deletions Generator/FastShowYamlGenerator.php

This file was deleted.

23 changes: 4 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
ACSEOFastShowGeneratorBundle
ACSEOFastShowGeneratorBundle
----------------------------

ACSEOFastShowGeneratorBundle allows to quickly generate show actions based on annotation or yaml
This bundle was initiated by Nicolas Kern ([ACSEO](http://www.acseo-conseil.fr)).

**Version**: 2.3-dev
**Compatibility**: Symfony >= 2.0.0, Twig >= 1.5.0
**Version**: 2.0
**Compatibility**: Symfony ^5.0, Twig >= 1.5.0

## Installation using Composer

Add the bundle in your composer.json:

```js
{
"require": {
"acseo/fast-show-generator-bundle": "dev-master"
}
}
```

Now tell composer to download the bundle by running the command:

``` bash
$ php composer.phar update acseo/fast-show-generator-bundle
$ composer install acseo/fast-show-generator-bundle
```

Composer will install the bundle to your project's `vendor/ACSEO` directory.


## How To Use

#### Annotation


In entity :
```php
use ACSEO\FastShowGeneratorBundle\Annotations as ACSEOFastShowGeneratorBundle;
Expand Down Expand Up @@ -87,7 +73,6 @@ In controller :
show : boolean - optional - if not set, value is assumed to be true
groups : array - optional - if not set, group name is "default"


## Template

Now, in your twig file, something like that :
Expand Down
7 changes: 0 additions & 7 deletions Resources/skeleton/fastshow/fastshow.yml.twig

This file was deleted.

12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
}
],
"require": {
"php": ">=5.3.2",
"symfony/symfony": ">=2.0.0"
},
"suggest": {

"doctrine/common": "^2.10",
"symfony/config": "^5.0",
"symfony/dependency-injection": "^5.0",
"symfony/http-kernel": "^5.0",
"symfony/yaml": "^5.0"
},
"autoload": {
"psr-0": { "ACSEO\\FastShowGeneratorBundle": "" }
Expand All @@ -28,7 +28,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.3-dev"
"dev-master": "2.0-dev"
}
}
}

0 comments on commit 3292e64

Please sign in to comment.