Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
easy-system committed Jun 13, 2016
0 parents commit d15f878
Show file tree
Hide file tree
Showing 14 changed files with 463 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage_clover: build/logs/clover.xml
json_path: build/logs/coveralls-upload.json
service_name: travis-ci
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: php

php:
- '5.5'
- '5.6'
- '7'

before_install:
- composer self-update
- composer require phpunit/phpunit:4.8.* satooshi/php-coveralls:dev-master
- composer install

script:
- mkdir -p build/logs
- phpunit --configuration phpunit.xml.dist --coverage-clover build/logs/clover.xml

after_success:
- php vendor/bin/coveralls

19 changes: 19 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2015-2016 Damon Smith

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Easy System MVC
===============
The package provides MVC layer interfaces.

[![Build Status](https://travis-ci.org/easy-system/es-mvc.svg?branch=master)](https://travis-ci.org/easy-system/es-mvc)
[![Coverage Status](https://coveralls.io/repos/github/easy-system/es-mvc/badge.svg?branch=master)](https://coveralls.io/github/easy-system/es-mvc?branch=master)
25 changes: 25 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "easy-system/es-mvc",
"description": "Easy System MVC",
"authors": [
{
"name": "Damon Smith",
"email": "damon.easy.system@gmail.com"
}
],
"require": {
"php": "^5.5 || ^7.0",
"easy-system/es-component": "*",
"easy-system/es-container": "*",
"easy-system/es-services": "*"
},
"autoload": {
"psr-4": {
"Es\\Mvc\\": "src/"
}
},
"autoload-dev": {
"psr-4": { "Es\\Mvc\\Test\\": "test/" }
},
"minimum-stability": "dev"
}
19 changes: 19 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
bootstrap="test/bootstrap.php"
colors="true"
stopOnSkipped="false"
verbose = "true"
>
<testsuites>
<testsuite name="Easy System - Mvc Test Suite">
<directory>test</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>
</phpunit>
35 changes: 35 additions & 0 deletions src/Component.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* This file is part of the "Easy System" package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Damon Smith <damon.easy.system@gmail.com>
*/
namespace Es\Mvc;

use Es\Component\ComponentInterface;

/**
* The system component.
*/
class Component implements ComponentInterface
{
/**
* The current version of component.
*
* @var string
*/
protected $version = '0.1.0';

/**
* Gets the current version of component.
*
* @return string The version of component
*/
public function getVersion()
{
return $this->version;
}
}
37 changes: 37 additions & 0 deletions src/ControllerPluginsInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* This file is part of the "Easy System" package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Damon Smith <damon.easy.system@gmail.com>
*/
namespace Es\Mvc;

use Es\Services\ServiceLocatorInterface;

/**
* The interface for the Collection of controller plugins.
*/
interface ControllerPluginsInterface extends ServiceLocatorInterface
{
/**
* Gets the plugin and sets its options.
*
* @param string $name The plugin name
* @param array $options Optional; the plugin options
*
* @return mixed The requested plugin
*/
public function getPlugin($name, array $options = []);

/**
* Merges with other plugins.
*
* @param ControllerPluginsInterface $source The data source
*
* @return self
*/
public function merge(ControllerPluginsInterface $source);
}
27 changes: 27 additions & 0 deletions src/ControllersInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* This file is part of the "Easy System" package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Damon Smith <damon.easy.system@gmail.com>
*/
namespace Es\Mvc;

use Es\Services\ServiceLocatorInterface;

/**
* The interface for the Collection of controllers.
*/
interface ControllersInterface extends ServiceLocatorInterface
{
/**
* Merges with other controllers.
*
* @param ControllersInterface $source The data source
*
* @return self
*/
public function merge(ControllersInterface $source);
}
30 changes: 30 additions & 0 deletions src/ModelsInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* This file is part of the "Easy System" package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Damon Smith <damon.easy.system@gmail.com>
*/
namespace Es\Mvc;

use Es\Services\ServiceLocatorInterface;

/**
* The interface for the Collection of models.
*
* The model can be any data source that you want (including the presentation
* of data using a database).
*/
interface ModelsInterface extends ServiceLocatorInterface
{
/**
* Merges with other models.
*
* @param ModelsInterface $source The data source
*
* @return self
*/
public function merge(ModelsInterface $source);
}
37 changes: 37 additions & 0 deletions src/ViewHelpersInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* This file is part of the "Easy System" package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Damon Smith <damon.easy.system@gmail.com>
*/
namespace Es\Mvc;

use Es\Services\ServiceLocatorInterface;

/**
* The interface for the Collection of view helpers.
*/
interface ViewHelpersInterface extends ServiceLocatorInterface
{
/**
* Gets the helper and sets its options.
*
* @param string $name The helper name
* @param array $options Optional; the helper options
*
* @return mixed The requested helper
*/
public function getHelper($name, array $options = []);

/**
* Merges with other view helpers.
*
* @param ViewHelpersInterface $source The data source
*
* @return self
*/
public function merge(ViewHelpersInterface $source);
}
39 changes: 39 additions & 0 deletions src/ViewInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* This file is part of the "Easy System" package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Damon Smith <damon.easy.system@gmail.com>
*/
namespace Es\Mvc;

/**
* The representation of View.
*/
interface ViewInterface
{
/**
* Sets the layout.
*
* @param ViewModelInterface $layout The layout
*/
public function setLayout(ViewModelInterface $layout);

/**
* Gets the layout.
*
* @return ViewModelInterface The layout
*/
public function getLayout();

/**
* Renders the model.
*
* @param ViewModelInterface $model The view model
*
* @return string Returns the result of rendering
*/
public function render(ViewModelInterface $model);
}
Loading

0 comments on commit d15f878

Please sign in to comment.