Skip to content

Commit

Permalink
Merge pull request #19 from fesiong/master
Browse files Browse the repository at this point in the history
add phalcon 4.0 version files to ide-strubs
  • Loading branch information
sergeyklay authored May 13, 2019
2 parents 0fd634a + 395f081 commit 9833934
Show file tree
Hide file tree
Showing 69 changed files with 4,080 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/Phalcon/Container.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace Phalcon;

use Psr\Container\ContainerInterface;
use Phalcon\DiInterface;

class Container implements ContainerInterface
{
/**
* @var <DiInterface>
*/
protected $container;

/**
* Phalcon\Di constructor
*/
public function __construct(DiInterface $container)
{
}

/**
* Return the service
*/
public function get($name) {
}

/**
* Whether a service exists or not in the container
*/
public function has($name) : bool
{
}
}
14 changes: 14 additions & 0 deletions src/Phalcon/Plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Phalcon;

/**
* Phalcon\Plugin
*
* This class can be used to provide user plugins an easy access to services
* in the application
*/
class Plugin extends \Phalcon\Di\Injectable
{

}
188 changes: 188 additions & 0 deletions src/Phalcon/Url.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<?php

namespace Phalcon;

use Phalcon\DiInterface;
use Phalcon\UrlInterface;
use Phalcon\Url\Exception;
use Phalcon\Mvc\RouterInterface;
use Phalcon\Mvc\Router\RouteInterface;
use Phalcon\Di\InjectionAwareInterface;

/**
* Phalcon\Url
*
* This components helps in the generation of: URIs, URLs and Paths
*
*<code>
* // Generate a URL appending the URI to the base URI
* echo $url->get("products/edit/1");
*
* // Generate a URL for a predefined route
* echo $url->get(
* [
* "for" => "blog-post",
* "title" => "some-cool-stuff",
* "year" => "2012",
* ]
* );
*</code>
*/
class Url implements UrlInterface, InjectionAwareInterface
{

/**
* @var null | string
*/
protected $baseUri = null;

/**
* @var null | string
*/
protected $basePath = null;

/**
* @var <DiInterface>
*/
protected $container;

protected $router;

/**
* @var null | string
*/
protected $staticBaseUri = null;

/**
* Generates a URL
*
*<code>
* // Generate a URL appending the URI to the base URI
* echo $url->get("products/edit/1");
*
* // Generate a URL for a predefined route
* echo $url->get(
* [
* "for" => "blog-post",
* "title" => "some-cool-stuff",
* "year" => "2015",
* ]
* );
*
* // Generate a URL with GET arguments (/show/products?id=1&name=Carrots)
* echo $url->get(
* "show/products",
* [
* "id" => 1,
* "name" => "Carrots",
* ]
* );
*
* // Generate an absolute URL by setting the third parameter as false.
* echo $url->get(
* "https://phalconphp.com/",
* null,
* false
* );
*</code>
*/
public function get($uri = null, $args = null, bool $local = null, $baseUri = null) : string
{
}

/**
* Returns the base path
*/
public function getBasePath() : string
{
}

/**
* Returns the prefix for all the generated urls. By default /
*/
public function getBaseUri() : string
{
}

/**
* Returns the DependencyInjector container
*/
public function getDI() : DiInterface
{
}

/**
* Generates a URL for a static resource
*
*<code>
* // Generate a URL for a static resource
* echo $url->getStatic("img/logo.png");
*
* // Generate a URL for a static predefined route
* echo $url->getStatic(
* [
* "for" => "logo-cdn",
* ]
* );
*</code>
*/
public function getStatic($uri = null) : string
{
}

/**
* Returns the prefix for all the generated static urls. By default /
*/
public function getStaticBaseUri() : string
{
}

/**
* Sets a base path for all the generated paths
*
*<code>
* $url->setBasePath("/var/www/htdocs/");
*</code>
*/
public function setBasePath(string $basePath) : UrlInterface
{
}

/**
* Sets a prefix for all the URIs to be generated
*
*<code>
* $url->setBaseUri("/invo/");
*
* $url->setBaseUri("/invo/index.php/");
*</code>
*/
public function setBaseUri(string $baseUri) : UrlInterface
{
}

/**
* Sets the DependencyInjector container
*/
public function setDI(DiInterface $dependencyInjector)
{
}

/**
* Sets a prefix for all static URLs generated
*
*<code>
* $url->setStaticBaseUri("/invo/");
*</code>
*/
public function setStaticBaseUri(string $staticBaseUri) : UrlInterface
{
}

/**
* Generates a local path
*/
public function path(string $path = null) : string
{
}
}
44 changes: 44 additions & 0 deletions src/Phalcon/Urlinterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace Phalcon;

/**
* Phalcon\UrlInterface
*
* Interface for Phalcon\UrlInterface
*/
interface UrlInterface
{
/**
* Generates a URL
*
* @param string|array uri
* @param array|object args Optional arguments to be appended to the query string
*/
public function get($uri = null, $args = null, bool $local = null) : string;

/**
* Returns a base path
*/
public function getBasePath() : string;

/**
* Returns the prefix for all the generated urls. By default /
*/
public function getBaseUri() : string;

/**
* Sets a base paths for all the generated paths
*/
public function setBasePath(string $basePath) : UrlInterface;

/**
* Sets a prefix to all the urls generated
*/
public function setBaseUri(string $baseUri) : UrlInterface;

/**
* Generates a local path
*/
public function path(string $path = null) : string;
}
57 changes: 57 additions & 0 deletions src/Phalcon/acl/Component.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace Phalcon\Acl;

use Phalcon\Acl\Exception;

/**
* Phalcon\Acl\Component
*
* This class defines component entity and its description
*/
class Component implements ComponentInterface
{

/**
* Component description
* @var string
*/
private $description;

/**
* Component name
* @var string
*/
private $name;

/**
* Phalcon\Acl\Component constructor
*/
public function __construct(string $name, string $description = null)
{
}

/**
* Returns component description
*/
public function getDescription(): string
{
// TODO: Implement getDescription() method.
}

/**
* Returns the component name
*/
public function getName(): string
{
// TODO: Implement getName() method.
}

/**
* Magic method __toString
*/
public function __toString(): string
{
// TODO: Implement __toString() method.
}
}
16 changes: 16 additions & 0 deletions src/Phalcon/acl/Componentaware.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Phalcon\Acl;

/**
* Phalcon\Acl\ComponentAware
*
* Interface for classes which could be used in allow method as RESOURCE
*/
interface ComponentAware
{
/**
* Returns component name
*/
public function getComponentName() : string;
}
27 changes: 27 additions & 0 deletions src/Phalcon/acl/Componentinterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Phalcon\Acl;

/**
*
* Phalcon\Acl\ComponentInterface
*
* Interface for Phalcon\Acl\Component
*/
interface ComponentInterface
{
/**
* Returns component description
*/
public function getDescription() : string;

/**
* Returns the component name
*/
public function getName() : string;

/**
* Magic method __toString
*/
public function __toString() : string;
}
Loading

0 comments on commit 9833934

Please sign in to comment.