Skip to content

Commit

Permalink
Remove obsolete type check
Browse files Browse the repository at this point in the history
  • Loading branch information
ragol committed Oct 30, 2015
1 parent 0bb2df5 commit 5447b78
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 18 deletions.
8 changes: 1 addition & 7 deletions lib/Serialiser.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,8 @@ protected function addPrefix($qname)
* Check and cleanup parameters passed to serialise() method
* @ignore
*/
protected function checkSerialiseParams(&$graph, &$format)
protected function checkSerialiseParams(&$format)
{
if (is_null($graph) or !is_object($graph) or !($graph instanceof Graph)) {
throw new \InvalidArgumentException(
'$graph should be an EasyRdf\Graph object and cannot be null'
);
}

if (is_null($format) or $format == '') {
throw new \InvalidArgumentException(
"\$format cannot be null or empty"
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialiser/Arc.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct()
*/
public function serialise(Graph $graph, $format, array $options = array())
{
parent::checkSerialiseParams($graph, $format);
parent::checkSerialiseParams($format);

if (array_key_exists($format, self::$supportedTypes)) {
$className = self::$supportedTypes[$format];
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialiser/GraphViz.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public function renderImage(Graph $graph, $format = 'png')
*/
public function serialise(Graph $graph, $format, array $options = array())
{
parent::checkSerialiseParams($graph, $format);
parent::checkSerialiseParams($format);

switch($format) {
case 'dot':
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialiser/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Json extends RdfPhp
*/
public function serialise(Graph $graph, $format, array $options = array())
{
parent::checkSerialiseParams($graph, $format);
parent::checkSerialiseParams($format);

if ($format != 'json') {
throw new Exception(
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialiser/JsonLd.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __construct()
*/
public function serialise(Graph $graph, $format, array $options = array())
{
parent::checkSerialiseParams($graph, $format);
parent::checkSerialiseParams($format);

if ($format != 'jsonld') {
throw new Exception(__CLASS__.' does not support: '.$format);
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialiser/Ntriples.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function serialiseValue($value)
*/
public function serialise(Graph $graph, $format, array $options = array())
{
parent::checkSerialiseParams($graph, $format);
parent::checkSerialiseParams($format);

if ($format == 'ntriples') {
$nt = '';
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialiser/Rapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function __construct($rapperCmd = 'rapper')
*/
public function serialise(Graph $graph, $format, array $options = array())
{
parent::checkSerialiseParams($graph, $format);
parent::checkSerialiseParams($format);

$ntriples = parent::serialise($graph, 'ntriples');

Expand Down
2 changes: 1 addition & 1 deletion lib/Serialiser/RdfPhp.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class RdfPhp extends Serialiser
*/
public function serialise(Graph $graph, $format, array $options = array())
{
parent::checkSerialiseParams($graph, $format);
parent::checkSerialiseParams($format);

if ($format != 'php') {
throw new Exception(
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialiser/RdfXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ protected function rdfxmlResource($res, $showNodeId, $depth = 1)
*/
public function serialise(Graph $graph, $format, array $options = array())
{
parent::checkSerialiseParams($graph, $format);
parent::checkSerialiseParams($format);

if ($format != 'rdfxml') {
throw new Exception(
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialiser/Turtle.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ protected function serialiseSubjects(Graph $graph, $filterType)
*/
public function serialise(Graph $graph, $format, array $options = array())
{
parent::checkSerialiseParams($graph, $format);
parent::checkSerialiseParams($format);

if ($format != 'turtle' and $format != 'n3') {
throw new Exception(
Expand Down
2 changes: 1 addition & 1 deletion test/EasyRdf/Serialiser/NtriplesArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function compareTriples($a, $b)
*/
public function serialise(Graph $graph, $format, array $options = array())
{
parent::checkSerialiseParams($graph, $format);
parent::checkSerialiseParams($format);

$triples = array();
foreach ($graph->toRdfPhp() as $resource => $properties) {
Expand Down
2 changes: 1 addition & 1 deletion test/EasyRdf/SerialiserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MockSerialiser extends Serialiser
{
public function serialise(Graph $graph, $format, array $options = array())
{
parent::checkSerialiseParams($graph, $format);
parent::checkSerialiseParams($format);
// Serialising goes here
return true;
}
Expand Down

0 comments on commit 5447b78

Please sign in to comment.