Skip to content

Commit 20e87bd

Browse files
committed
Init
0 parents  commit 20e87bd

File tree

10 files changed

+415
-0
lines changed

10 files changed

+415
-0
lines changed

Api/WordpressClient.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Happyr\WordpressBundle\Api;
6+
7+
use Happyr\WordpressBundle\Model\Menu;
8+
use Happyr\WordpressBundle\Model\Page;
9+
10+
class WordpressClient
11+
{
12+
/**
13+
* @var CacheInterface
14+
*/
15+
private $cache;
16+
17+
public function getPage($idOrSlug): Page
18+
{
19+
20+
}
21+
22+
public function getMenu($idOrSlug): Menu
23+
{
24+
25+
}
26+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace Happyr\WordpressBundle\DependencyInjection;
4+
5+
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6+
use Symfony\Component\Config\Definition\ConfigurationInterface;
7+
8+
/**
9+
* This class contains the configuration information for the bundle.
10+
*
11+
* This information is solely responsible for how the different configuration
12+
* sections are normalized, and merged.
13+
*
14+
* @author Tobias Nyholm <[email protected]>
15+
*/
16+
class Configuration implements ConfigurationInterface
17+
{
18+
public function getConfigTreeBuilder()
19+
{
20+
$treeBuilder = new TreeBuilder();
21+
$rootNode = $treeBuilder->root('wordpress');
22+
$rootNode->children()
23+
->scalarNode('url')->cannotBeEmpty()->end()
24+
->end();
25+
26+
27+
}
28+
29+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace Happyr\WordpressBundle\DependencyInjection;
4+
5+
use Symfony\Component\Config\FileLocator;
6+
use Symfony\Component\DependencyInjection\ContainerBuilder;
7+
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
8+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9+
10+
/**
11+
* @author Tobias Nyholm <[email protected]>
12+
*/
13+
class WordpressExtension extends Extension
14+
{
15+
/**
16+
* {@inheritdoc}
17+
*/
18+
public function load(array $configs, ContainerBuilder $container)
19+
{
20+
$configuration = $this->getConfiguration($configs, $container);
21+
$config = $this->processConfiguration($configuration, $configs);
22+
23+
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
24+
25+
$loader->load('services.yml');
26+
}
27+
}

Model/Menu.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Happyr\WordpressBundle\Model;
6+
7+
class Menu
8+
{
9+
10+
}

Model/Page.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Happyr\WordpressBundle\Model;
6+
7+
class Page
8+
{
9+
10+
}

Resources/config/services.yml

Whitespace-only changes.

Twig/WordpressExtension.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Happyr\WordpressBundle\Twig;
6+
7+
class WordpressExtension
8+
{
9+
10+
}

WordpressBundle.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace Happyr\WordpressBundle;
4+
5+
use Symfony\Component\HttpKernel\Bundle\Bundle;
6+
7+
/**
8+
* @author Tobias Nyholm <[email protected]>
9+
*/
10+
class WordpressBundle extends Bundle
11+
{
12+
}

composer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "happyr/wordpress-bundle",
3+
"type": "symfony-bundle",
4+
"license": "MIT",
5+
"require": {
6+
"php": "^7.1.3",
7+
"symfony/contracts": "dev-master"
8+
},
9+
"require-dev": {
10+
"twig/twig": "^2.0"
11+
},
12+
"config": {
13+
"sort-packages": true
14+
},
15+
"autoload": {
16+
"psr-4": {
17+
"Happyr\\WordpressBundle\\": ""
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)