mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
One file - one class (#24)
This commit is contained in:
@ -8,6 +8,8 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace Fenom;
|
||||
use Fenom\Error\InvalidUsageException;
|
||||
use Fenom\Error\UnexpectedTokenException;
|
||||
use Fenom\Tokenizer;
|
||||
use Fenom\Template;
|
||||
use Fenom\Scope;
|
||||
|
18
src/Fenom/Error/CompileException.php
Normal file
18
src/Fenom/Error/CompileException.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Fenom.
|
||||
*
|
||||
* (c) 2013 Ivan Shalganov
|
||||
*
|
||||
* For the full copyright and license information, please view the license.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Fenom\Error;
|
||||
|
||||
/**
|
||||
* @package Fenom\Error
|
||||
*/
|
||||
class CompileException extends \ErrorException
|
||||
{
|
||||
}
|
18
src/Fenom/Error/InvalidUsageException.php
Normal file
18
src/Fenom/Error/InvalidUsageException.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Fenom.
|
||||
*
|
||||
* (c) 2013 Ivan Shalganov
|
||||
*
|
||||
* For the full copyright and license information, please view the license.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Fenom\Error;
|
||||
|
||||
/**
|
||||
* @package Fenom\Error
|
||||
*/
|
||||
class InvalidUsageException extends \LogicException
|
||||
{
|
||||
}
|
18
src/Fenom/Error/SecurityException.php
Normal file
18
src/Fenom/Error/SecurityException.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Fenom.
|
||||
*
|
||||
* (c) 2013 Ivan Shalganov
|
||||
*
|
||||
* For the full copyright and license information, please view the license.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Fenom\Error;
|
||||
|
||||
/**
|
||||
* @package Fenom\Error
|
||||
*/
|
||||
class SecurityException extends CompileException
|
||||
{
|
||||
}
|
18
src/Fenom/Error/TokenizeException.php
Normal file
18
src/Fenom/Error/TokenizeException.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Fenom.
|
||||
*
|
||||
* (c) 2013 Ivan Shalganov
|
||||
*
|
||||
* For the full copyright and license information, please view the license.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Fenom\Error;
|
||||
|
||||
/**
|
||||
* @package Fenom\Error
|
||||
*/
|
||||
class TokenizeException extends \RuntimeException
|
||||
{
|
||||
}
|
@ -1,6 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Fenom.
|
||||
*
|
||||
* (c) 2013 Ivan Shalganov
|
||||
*
|
||||
* For the full copyright and license information, please view the license.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Fenom;
|
||||
namespace Fenom\Error;
|
||||
use Fenom\Tokenizer;
|
||||
|
||||
/**
|
||||
* Unexpected token
|
@ -8,7 +8,12 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace Fenom;
|
||||
use Fenom;
|
||||
use Fenom,
|
||||
Fenom\Error\UnexpectedTokenException;
|
||||
use Fenom\Error\CompileException;
|
||||
use Fenom\Error\InvalidUsageException;
|
||||
use Fenom\Error\SecurityException;
|
||||
use Fenom\Error\TokenizeException;
|
||||
|
||||
/**
|
||||
* Template compiler
|
||||
@ -146,7 +151,7 @@ class Template extends Render
|
||||
* Load source from provider
|
||||
* @param string $name
|
||||
* @param bool $compile
|
||||
* @return $this
|
||||
* @return self
|
||||
*/
|
||||
public function load($name, $compile = true)
|
||||
{
|
||||
@ -1370,20 +1375,4 @@ class Template extends Render
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
|
||||
class CompileException extends \ErrorException
|
||||
{
|
||||
}
|
||||
|
||||
class SecurityException extends CompileException
|
||||
{
|
||||
}
|
||||
|
||||
class InvalidUsageException extends \LogicException
|
||||
{
|
||||
}
|
||||
|
||||
class TokenizeException extends \RuntimeException
|
||||
{
|
||||
}
|
@ -9,16 +9,18 @@
|
||||
*/
|
||||
namespace Fenom;
|
||||
|
||||
use Fenom\Error\UnexpectedTokenException;
|
||||
|
||||
/**
|
||||
* for <PHP 5.4 compatible
|
||||
* for PHP <5.4 compatible
|
||||
*/
|
||||
defined('T_INSTEADOF') || define('T_INSTEADOF', 341);
|
||||
defined('T_TRAIT') || define('T_TRAIT', 355);
|
||||
defined('T_TRAIT_C') || define('T_TRAIT_C', 365);
|
||||
/**
|
||||
* for PHP <5.5
|
||||
* for PHP <5.5 compatible
|
||||
*/
|
||||
defined('T_YIELD') || define('T_YIELD', 370);
|
||||
defined('T_YIELD') || define('T_YIELD', 390);
|
||||
|
||||
/**
|
||||
* Each token have structure
|
||||
|
Reference in New Issue
Block a user