-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement #6: add 'discovery' package
- Loading branch information
Bui Sy Nguyen
committed
Jan 22, 2016
1 parent
cc46204
commit 2328401
Showing
5 changed files
with
416 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
/////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// © Copyright f-project.net 2010-present. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
namespace fproject\amf\discovery; | ||
|
||
/** | ||
* The information necessary for a service router to be able to load a class' file and instanciate it | ||
* could be extended later with namespaces when they become mainstream | ||
* | ||
* @package Amfphp_Core_Common | ||
* @author Ariel Sommeria-klein | ||
*/ | ||
class ClassFindInfo { | ||
|
||
/** | ||
* the absolute path to the file containing the class definition | ||
* @var String | ||
*/ | ||
public $absolutePath; | ||
|
||
/** | ||
* the name of the class. | ||
* @var String | ||
*/ | ||
public $className; | ||
|
||
/** | ||
* constructor | ||
* @param String $absolutePath | ||
* @param String $className | ||
*/ | ||
public function __construct($absolutePath, $className) { | ||
$this->absolutePath = $absolutePath; | ||
$this->className = $className; | ||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
/////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// © Copyright f-project.net 2010-present. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
namespace fproject\amf\discovery; | ||
|
||
/** | ||
* Contains all collected information about a service method. | ||
* | ||
* @author Ariel Sommeria-klein | ||
* @package Amfphp_Plugins_Discovery | ||
*/ | ||
class MethodDescriptor { | ||
|
||
/** | ||
* name | ||
* @var string | ||
*/ | ||
public $name; | ||
|
||
/** | ||
* | ||
* @var ParameterDescriptor[] array of ParameterDescriptor | ||
*/ | ||
public $parameters; | ||
|
||
/** | ||
* | ||
* @var string method level comment | ||
*/ | ||
public $comment; | ||
|
||
/** | ||
* return type | ||
* @var string | ||
*/ | ||
public $returnType; | ||
|
||
/** | ||
* constructor | ||
* @param string $name | ||
* @param array $parameters | ||
* @param string $comment | ||
* @param string $returnType | ||
*/ | ||
public function __construct($name, array $parameters, $comment, $returnType) { | ||
$this->name = $name; | ||
$this->parameters = $parameters; | ||
$this->comment = $comment; | ||
$this->returnType = $returnType; | ||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
/////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// © Copyright f-project.net 2010-present. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
namespace fproject\amf\discovery; | ||
|
||
/** | ||
* Contains all collected information about a service method parameter | ||
* | ||
* @author Ariel Sommeria-klein | ||
* @package Amfphp_Plugins_Discovery | ||
*/ | ||
class ParameterDescriptor { | ||
|
||
/** | ||
* name | ||
* @var string | ||
*/ | ||
public $name; | ||
|
||
/** | ||
* This can be gathered in 2 manners: commentary tag analysis and type hinting analysis. For starters only the second method is used | ||
* @var String | ||
*/ | ||
public $type; | ||
|
||
/** | ||
* constructor | ||
* @param String $name | ||
* @param String $type | ||
*/ | ||
public function __construct($name, $type) { | ||
$this->name = $name; | ||
$this->type = $type; | ||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
/////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// © Copyright f-project.net 2010-present. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
namespace fproject\amf\discovery; | ||
|
||
/** | ||
* Contains all collected information about a service. This information will be used by the generator. | ||
* | ||
* @author Ariel Sommeria-klein | ||
* @package Amfphp_Plugins_Discovery | ||
*/ | ||
class ServiceDescriptor { | ||
/** | ||
*name | ||
* @var string | ||
*/ | ||
public $name; | ||
/** | ||
* methods | ||
* @var MethodDescriptor[] an array of MethodDescriptor | ||
*/ | ||
public $methods; | ||
|
||
/** | ||
* class level comment | ||
* @var string | ||
*/ | ||
public $comment; | ||
|
||
/** | ||
* constructor | ||
* @param string $name | ||
* @param MethodDescriptor[] $methods | ||
* @param string $comment | ||
*/ | ||
public function __construct($name, array $methods, $comment) { | ||
$this->name = $name; | ||
$this->methods = $methods; | ||
$this->comment = $comment; | ||
} | ||
} | ||
|
||
?> |
Oops, something went wrong.