Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Util.php: fixed string concatenation (+ => .) #16

Merged
merged 7 commits into from
Nov 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ We have thus implemented this triple representation using associative arrays rat
$triple = [
'subject' => 'http://example.org/cartoons#Tom',
'predicate' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type',
'object' => 'http://example.org/cartoons#Cat'
,'graph' => 'http://example.org/mycartoon' #optional
'object' => 'http://example.org/cartoons#Cat',
'graph' => 'http://example.org/mycartoon', #optional
];
```

Expand Down
6 changes: 3 additions & 3 deletions src/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static function getLiteralValue ($literal)
{
preg_match("/^\"(.*)\"/", $literal, $match); //TODO: somehow the copied regex did not work. To be checked. Contained [^]
if (empty($match)) {
throw new Error($literal + ' is not a literal');
throw new \Exception($literal . ' is not a literal');
}
return $match[1];
}
Expand All @@ -58,7 +58,7 @@ public static function getLiteralType ($literal)
{
preg_match('/^".*"(?:\^\^([^"]+)|(@)[^@"]+)?$/',$literal,$match);//TODO: somehow the copied regex did not work. To be checked. Contained [^] instead of the .
if (empty($match))
throw new Error($literal + ' is not a literal');
throw new \Exception($literal . ' is not a literal');
if (!empty($match[1])) {
return $match[1];
} else {
Expand All @@ -72,7 +72,7 @@ public static function getLiteralLanguage ($literal)
{
preg_match('/^".*"(?:@([^@"]+)|\^\^[^"]+)?$/', $literal, $match);
if (empty($match))
throw new Error($literal + ' is not a literal');
throw new \Exception($literal . ' is not a literal');
return isset($match[1]) ? strtolower($match[1]) : '';
}

Expand Down