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

TASK: Unify exception codes in Abstract(Template)View #3413

Open
wants to merge 2 commits into
base: 8.3
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions Neos.Flow/Classes/Mvc/View/AbstractView.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function __construct(array $options = [])
$this->supportedOptions,
function ($supportedOptionData, $supportedOptionName, $options) {
if (isset($supportedOptionData[3]) && !array_key_exists($supportedOptionName, $options)) {
throw new Exception('Required view option not set: ' . $supportedOptionName, 1359625876);
throw new Exception('Required view option not set: ' . $supportedOptionName, 1359625877);
}
},
$options
Expand Down Expand Up @@ -112,7 +112,7 @@ function ($value) {
public function getOption($optionName)
{
if (!array_key_exists($optionName, $this->supportedOptions)) {
throw new Exception(sprintf('The view option "%s" you\'re trying to get doesn\'t exist in class "%s".', $optionName, get_class($this)), 1359625876);
throw new Exception(sprintf('The view option "%s" you\'re trying to get doesn\'t exist in class "%s".', $optionName, get_class($this)), 1359625878);
}

return $this->options[$optionName];
Expand All @@ -129,7 +129,7 @@ public function getOption($optionName)
public function setOption($optionName, $value)
{
if (!array_key_exists($optionName, $this->supportedOptions)) {
throw new Exception(sprintf('The view option "%s" you\'re trying to set doesn\'t exist in class "%s".', $optionName, get_class($this)), 1359625876);
throw new Exception(sprintf('The view option "%s" you\'re trying to set doesn\'t exist in class "%s".', $optionName, get_class($this)), 1359625879);
}

$this->options[$optionName] = $value;
Expand Down
8 changes: 4 additions & 4 deletions Neos.FluidAdaptor/Classes/View/AbstractTemplateView.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ protected function validateOptions(array $options)
{
// check for options given but not supported
if (($unsupportedOptions = array_diff_key($options, $this->supportedOptions)) !== []) {
throw new Exception(sprintf('The view options "%s" you\'re trying to set don\'t exist in class "%s".', implode(',', array_keys($unsupportedOptions)), get_class($this)), 1359625876);
throw new Exception(sprintf('The view options "%s" you\'re trying to set don\'t exist in class "%s".', implode(',', array_keys($unsupportedOptions)), get_class($this)), 1359625880);
}

// check for required options being set
array_walk(
$this->supportedOptions,
function ($supportedOptionData, $supportedOptionName, $options) {
if (isset($supportedOptionData[3]) && !array_key_exists($supportedOptionName, $options)) {
throw new Exception('Required view option not set: ' . $supportedOptionName, 1359625876);
throw new Exception('Required view option not set: ' . $supportedOptionName, 1359625881);
}
},
$options
Expand Down Expand Up @@ -261,7 +261,7 @@ function ($value) {
public function getOption($optionName)
{
if (!array_key_exists($optionName, $this->supportedOptions)) {
throw new \Neos\Flow\Mvc\Exception(sprintf('The view option "%s" you\'re trying to get doesn\'t exist in class "%s".', $optionName, get_class($this)), 1359625876);
throw new \Neos\Flow\Mvc\Exception(sprintf('The view option "%s" you\'re trying to get doesn\'t exist in class "%s".', $optionName, get_class($this)), 1359625882);
}

return $this->options[$optionName];
Expand All @@ -278,7 +278,7 @@ public function getOption($optionName)
public function setOption($optionName, $value)
{
if (!array_key_exists($optionName, $this->supportedOptions)) {
throw new \Neos\Flow\Mvc\Exception(sprintf('The view option "%s" you\'re trying to set doesn\'t exist in class "%s".', $optionName, get_class($this)), 1359625876);
throw new \Neos\Flow\Mvc\Exception(sprintf('The view option "%s" you\'re trying to set doesn\'t exist in class "%s".', $optionName, get_class($this)), 1359625883);
}

$this->options[$optionName] = $value;
Expand Down
Loading