Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (1)
Added information multi interface
· a6ac2a19
Anastaszor
authored
Feb 02, 2020
a6ac2a19
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
a6ac2a19
...
...
@@ -11,7 +11,7 @@ Then add to your composer.json :
```
json
"require"
:
{
...
"php-extended/php-information-interface"
:
"^1
4
"
,
"php-extended/php-information-interface"
:
"^1
5
"
,
...
}
```
...
...
@@ -147,6 +147,13 @@ of the triple (or tuple).
It can represent information for a specific object or a relation between two
objects or a reference list.
### InformationMultiInterface
The
`InformationMultiInterface`
is a complex information that carries
in one go multiple data and self-relation informations.
It represents a complete object full of its own informations.
### InformationVisitorInterface
The
`InformationVisitorInterface`
is the only object that can interact
...
...
composer.json
View file @
a6ac2a19
...
...
@@ -23,5 +23,8 @@
"information"
,
"interface"
],
"license"
:
"MIT"
"license"
:
"MIT"
,
"require"
:
{
"php"
:
">=7.0"
}
}
\ No newline at end of file
src/InformationDataInterface.php
View file @
a6ac2a19
...
...
@@ -23,6 +23,6 @@ interface InformationDataInterface extends InformationInterface, PartDataInterfa
*
* @return string
*/
public
function
getObjectId
();
public
function
getObjectId
()
:
string
;
}
src/InformationInterface.php
View file @
a6ac2a19
...
...
@@ -26,15 +26,21 @@ interface InformationInterface
*
* @return string
*/
public
function
getOriginId
();
public
function
getOriginId
()
:
string
;
/**
* The category of this specific information. This MUST NOT be null.
*
* @return string
*/
public
function
getCategory
()
:
string
;
/**
* The identifier of this specific information. This MUST NOT be null.
*
* @return string
* @todo add getCategory
*/
public
function
getId
();
public
function
getId
()
:
string
;
/**
* The number of this information, generated from the beginning of the flux
...
...
@@ -42,14 +48,14 @@ interface InformationInterface
*
* @return integer
*/
public
function
getNumber
();
public
function
getNumber
()
:
int
;
/**
* Gets the date and time when this information was created.
*
* @return \DateTime
* @return \DateTime
Interface
*/
public
function
getCreationDate
();
public
function
getCreationDate
()
:
\DateTimeInterface
;
/**
* The class of the object the information is extracted from. This field
...
...
@@ -57,7 +63,7 @@ interface InformationInterface
*
* @return string
*/
public
function
getSupportClass
();
public
function
getSupportClass
()
:
string
;
/**
* Makes the given visitor to visit this interface. This method MAY return
...
...
src/InformationIteratorInterface.php
View file @
a6ac2a19
...
...
@@ -19,6 +19,7 @@ interface InformationIteratorInterface extends \Iterator, \Countable
/**
* {@inheritDoc}
* @see \Iterator::current()
* @return InformationInterface
*/
public
function
current
()
:
InformationInterface
;
...
...
src/InformationMultiInterface.php
0 → 100644
View file @
a6ac2a19
<?php
namespace
PhpExtended\Information
;
/**
* InformationMultiInterface interface file.
*
* This interface is for all informations that are gatherered. It permits to
* have a single entry point for all type of informations.
*
* The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
* "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to
* be interpreted as described in RFC 2119.
*
* @author Anastaszor
*/
interface
InformationMultiInterface
extends
InformationInterface
{
/**
* Gets all the datas that are gathered by this multi information.
*
* @return \Iterator[InformationDataInterface]
*/
public
function
getInformationDatas
()
:
\Iterator
;
/**
* Gets all the data timed that are gathered by this multi information.
*
* @return \Iterator[InformationDataTimedInterface]
*/
public
function
getInformationDataTimeds
()
:
\Iterator
;
/**
* Gets all the relations that are self related to this multi information.
*
* @return \Iterator[InformationRelationInterface]
*/
public
function
getInformationRelations
()
:
\Iterator
;
}
src/InformationTripleInterface.php
View file @
a6ac2a19
...
...
@@ -21,20 +21,20 @@ interface InformationTripleInterface extends InformationInterface
*
* @return string
*/
public
function
getSubject
();
public
function
getSubject
()
:
string
;
/**
* The predicate of the triple object. This field MUST NOT be null.
*
* @return string
*/
public
function
getPredicate
();
public
function
getPredicate
()
:
string
;
/**
* The object of the triple object. This field SHOULD NOT be null.
*
* @return string
*/
public
function
getObject
();
public
function
getObject
()
:
string
;
}
src/InformationVisitorInterface.php
View file @
a6ac2a19
...
...
@@ -18,129 +18,128 @@ interface InformationVisitorInterface
{
/**
* Makes this visitor visits specifically an information of type data. This
* method MAY return null, and it SHOULD be treated as false.
* Makes this visitor visits specifically an information of type data.
*
* @param InformationDataInterface $informationData
* @return boolean whether the visit may continue.
* @throws \Exception if the visiting process could not be done
*/
public
function
visitData
(
InformationDataInterface
$informationData
);
public
function
visitData
(
InformationDataInterface
$informationData
)
:
bool
;
/**
* Makes this visitor visits specifically an information of type timed data.
* This method MAY return null, and it SHOULD be treated as false.
*
* @param InformationDataTimedInterface $informationTimedData
* @return boolean whether the visit may continue.
* @throws \Exception if the visiting process could not be done
*/
public
function
visitDataTimed
(
InformationDataTimedInterface
$informationTimedData
);
public
function
visitDataTimed
(
InformationDataTimedInterface
$informationTimedData
)
:
bool
;
/**
* Makes this visitor visits specifically an information of type relation.
* This method MAY return null, and it SHOULD be treated as false.
*
* @param InformationRelationInterface $informationRelation
* @return boolean whether the visit may continue.
* @throws \Exception if the visiting process could not be done
*/
public
function
visitRelation
(
InformationRelationInterface
$informationRelation
);
public
function
visitRelation
(
InformationRelationInterface
$informationRelation
)
:
bool
;
/**
* Makes this visitor visits specifically an information of type timed
* relation.
This method MAY return null, and it SHOULD be treated as false.
* relation.
*
* @param InformationRelationTimedInterface $informationTimedRelation
* @return boolean whether the visit may continue.
* @throws \Exception if the visiting process could not be done
*/
public
function
visitRelationTimed
(
InformationRelationTimedInterface
$informationTimedRelation
);
public
function
visitRelationTimed
(
InformationRelationTimedInterface
$informationTimedRelation
)
:
bool
;
/**
* Makes this visitor visits specifically an information of type relation
* data.
This method MAY return null, and it SHOULD be treated as false.
* data.
*
* @param InformationRelationDataInterface $informationRelationData
* @return boolean whether the visit may continue.
* @throws \Exception if the visiting process could not be done
*/
public
function
visitRelationData
(
InformationRelationDataInterface
$informationRelationData
);
public
function
visitRelationData
(
InformationRelationDataInterface
$informationRelationData
)
:
bool
;
/**
* Makes this visitor visits specifically an information of type timed
* relation data. This method MAY return null, and it SHOULD be treated as
* false.
* relation data.
*
* @param InformationRelationDataTimedInterface $informationTimedRelationData
* @return boolean whether the visit may continue.
* @throws \Exception if the visiting process could not be done
*/
public
function
visitRelationDataTimed
(
InformationRelationDataTimedInterface
$informationTimedRelationData
);
public
function
visitRelationDataTimed
(
InformationRelationDataTimedInterface
$informationTimedRelationData
)
:
bool
;
/**
* Makes this visitor visits specifically an information of type timed
* mono relation. This method MAY return null, and it SHOULD be treated as
* false.
* mono relation.
*
* @param InformationCompositeTimedInterface $informationTimedComposite
* @return boolean whether the visit may continue.
* @throws \Exception if the visiting process could not be done
*/
public
function
visitCompositeTimed
(
InformationCompositeTimedInterface
$informationTimedComposite
);
public
function
visitCompositeTimed
(
InformationCompositeTimedInterface
$informationTimedComposite
)
:
bool
;
/**
* Makes this visitor visits specifically an information of type mono
* relation data. This method MAY return null, and it SHOULD be treated as
* false.
* relation data.
*
* @param InformationCompositeDataInterface $informationCompositeData
* @return boolean whether the visit may continue.
* @throws \Exception if the visiting process could not be done
*/
public
function
visitCompositeData
(
InformationCompositeDataInterface
$informationCompositeData
);
public
function
visitCompositeData
(
InformationCompositeDataInterface
$informationCompositeData
)
:
bool
;
/**
* Makes this visitor visits specifically an information of type timed
* mono relation data. This method MAY return null, and it SHOULD be treated
* as false.
* mono relation data.
*
* @param InformationCompositeDataTimedInterface $informationTimedCompositeData
* @return boolean whether the visit may continue.
* @throws \Exception if the visiting process could not be done
*/
public
function
visitCompositeDataTimed
(
InformationCompositeDataTimedInterface
$informationTimedCompositeData
);
public
function
visitCompositeDataTimed
(
InformationCompositeDataTimedInterface
$informationTimedCompositeData
)
:
bool
;
/**
* Makes this visitor visits specifically a information of type mono
* relation relation. This method MAY return null, and it SHOULD be treated
* as false.
* relation relation.
*
* @param InformationCompositeRelationInterface $informationCompositeRelation
* @return boolean whether the visit may continue.
* @throws \Exception if the visiting process could not be done
*/
public
function
visitCompositeRelation
(
InformationCompositeRelationInterface
$informationCompositeRelation
);
public
function
visitCompositeRelation
(
InformationCompositeRelationInterface
$informationCompositeRelation
)
:
bool
;
/**
* Makes this visitor visits specifically an information of type timed
* mono relation relation. This method MAY return null, and it SHOULD be
* treated as false.
* mono relation relation.
*
* @param InformationCompositeRelationTimedInterface $informationTimedCompositeRelation
* @return boolean whether the visit may continue.
* @throws \Exception if the visiting process could not be done
*/
public
function
visitCompositeRelationTimed
(
InformationCompositeRelationTimedInterface
$informationTimedCompositeRelation
);
public
function
visitCompositeRelationTimed
(
InformationCompositeRelationTimedInterface
$informationTimedCompositeRelation
)
:
bool
;
/**
* Makes this visitor visits specifically an information of type triple.
* This method MAY return null, and it SHOULD be treated as false.
*
* @param InformationTripleInterface $informationTriple
* @return boolean whether the visit may continue
* @throws \Exception if the visiting process could not be done
*/
public
function
visitTriple
(
InformationTripleInterface
$informationTriple
);
public
function
visitTriple
(
InformationTripleInterface
$informationTriple
)
:
bool
;
/**
* Makes this visitor visits specifically an information of type multi.
*
* @param InformationMultiInterface $informationMulti
* @return boolean whether the visit may continue
* @throws \Exception if the visiting process could not be done
*/
public
function
visitMulti
(
InformationMultiInterface
$informationMulti
)
:
bool
;
}
src/PartCompositeInterface.php
View file @
a6ac2a19
...
...
@@ -22,7 +22,7 @@ interface PartCompositeInterface
*
* @return string
*/
public
function
getCompositeName
();
public
function
getCompositeName
()
:
string
;
/**
* Gets the identifier of the source component of the relation. This field
...
...
@@ -30,6 +30,6 @@ interface PartCompositeInterface
*
* @return string
*/
public
function
getCompositeId
();
public
function
getCompositeId
()
:
string
;
}
src/PartDataInterface.php
View file @
a6ac2a19
...
...
@@ -24,13 +24,13 @@ interface PartDataInterface
*
* @return string
*/
public
function
getField
();
public
function
getField
()
:
string
;
/**
* Gets the effective data the support object has. This field MAY be null.
*
* @return string
*/
public
function
getData
();
public
function
getData
()
:
string
;
}
src/PartSourceInterface.php
View file @
a6ac2a19
...
...
@@ -24,7 +24,7 @@ interface PartSourceInterface
*
* @return string
*/
public
function
getSourceName
();
public
function
getSourceName
()
:
string
;
/**
* Gets the identifier of the source component of the relation. This field
...
...
@@ -32,6 +32,6 @@ interface PartSourceInterface
*
* @return string
*/
public
function
getSourceId
();
public
function
getSourceId
()
:
string
;
}
src/PartTargetInterface.php
View file @
a6ac2a19
...
...
@@ -24,7 +24,7 @@ interface PartTargetInterface
*
* @return string
*/
public
function
getTargetName
();
public
function
getTargetName
()
:
string
;
/**
* Gets the identifier of the target component of the relation. This field
...
...
@@ -32,6 +32,6 @@ interface PartTargetInterface
*
* @return string
*/
public
function
getTargetId
();
public
function
getTargetId
()
:
string
;
}
src/PartTimedInterface.php
View file @
a6ac2a19
...
...
@@ -24,7 +24,7 @@ interface PartTimedInterface
*
* @return string
*/
public
function
getTimeField
();
public
function
getTimeField
()
:
string
;
/**
* Gets the format in which the time string should be transmitted or stored.
...
...
@@ -32,13 +32,13 @@ interface PartTimedInterface
*
* @return string
*/
public
function
getTimeFormat
();
public
function
getTimeFormat
()
:
string
;
/**
* Gets the time value in a date time object. This field MUST NOT be null.
*
* @return \DateTime
* @return \DateTime
Interface
*/
public
function
getTimeValue
();
public
function
getTimeValue
()
:
\DateTimeInterface
;
}