diff --git a/.gitignore b/.gitignore
index e8f3980a7..116afbea7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.idea
build/
web/css/site.css
web/js/site.js
diff --git a/app/src/Apikey/ApikeyApi.php b/app/src/Apikey/ApikeyApi.php
index 9dbd9ddc6..ed6fd483a 100644
--- a/app/src/Apikey/ApikeyApi.php
+++ b/app/src/Apikey/ApikeyApi.php
@@ -1,7 +1,7 @@
'yes'])
*/
public function deleteClient($tokenUri)
{
- list ($status, $result, $headers) = $this->apiDelete($tokenUri);
+ list($status, $result, $headers) = $this->apiDelete($tokenUri);
if ($status != 204) {
$decoded = json_decode($result);
diff --git a/app/src/Apikey/ApikeyController.php b/app/src/Apikey/ApikeyController.php
index f6c936ea2..7c43a3887 100644
--- a/app/src/Apikey/ApikeyController.php
+++ b/app/src/Apikey/ApikeyController.php
@@ -1,19 +1,18 @@
get('/user/:username/apikey', array($this, 'index'))->name('apikey-show');
- $app->get('/user/:username/apikey/:apikey/delete', array($this, 'deleteApiKey'))->via('GET', 'POST')->name('apikey-delete');
+ $app->get('/user/:username/apikey', [$this, 'index'])->name('apikey-show');
+ $app->get('/user/:username/apikey/:apikey/delete', [$this, 'deleteApiKey'])->via('GET', 'POST')->name('apikey-delete');
}
public function index($username)
@@ -63,11 +62,11 @@ public function deleteApiKey($username, $apikey)
}
// default values
- $data = [];
- $data['apikey_id'] = $apikey->getId();
+ $data = [];
+ $data['apikey_id'] = $apikey->getId();
$factory = $this->application->formFactory;
- $form = $factory->create(new ApikeyDeleteFormType(), $data);
+ $form = $factory->create(new ApikeyDeleteFormType(), $data);
$request = $this->application->request();
@@ -86,7 +85,7 @@ public function deleteApiKey($username, $apikey)
$this->application->urlFor('apikey-show', ['username' => $username])
);
return;
- } catch (\RuntimeException $e) {
+ } catch (RuntimeException $e) {
$form->adderror(
new FormError('An error occurred while removing this API-Key: ' . $e->getmessage())
);
@@ -97,10 +96,10 @@ public function deleteApiKey($username, $apikey)
$this->render(
'Apikey/delete.html.twig',
[
- 'apikey' => $apikey,
- 'form' => $form->createView(),
+ 'apikey' => $apikey,
+ 'form' => $form->createView(),
'backUri' => $this->application->urlFor('apikey-show', ['username' => $username]),
- 'user' => $_SESSION['user'],
+ 'user' => $_SESSION['user'],
]
);
}
diff --git a/app/src/Apikey/ApikeyDeleteFormType.php b/app/src/Apikey/ApikeyDeleteFormType.php
index 3028159e9..98d6a90e2 100644
--- a/app/src/Apikey/ApikeyDeleteFormType.php
+++ b/app/src/Apikey/ApikeyDeleteFormType.php
@@ -1,11 +1,9 @@
data->last_used_date);
+ return new DateTimeImmutable($this->data->last_used_date);
}
public function getCreationDateTime()
{
- return new \DateTimeImmutable($this->data->created_date);
+ return new DateTimeImmutable($this->data->created_date);
}
diff --git a/app/src/Application/ApplicationController.php b/app/src/Application/ApplicationController.php
index 2ba9aaa93..e9c27baed 100755
--- a/app/src/Application/ApplicationController.php
+++ b/app/src/Application/ApplicationController.php
@@ -1,20 +1,20 @@
get('/', array($this, 'index'));
- $app->get('/about', array($this, 'about'))->name('about');
- $app->map('/contact', array($this, 'contact'))->via('GET', 'POST')->name('contact');
- $app->get('/not-allowed', array($this, 'notAllowed'))->name('not-allowed');
- $app->get('/assets', array($this, 'assets'))->name('assets');
+ $app->get('/', [$this, 'index']);
+ $app->get('/about', [$this, 'about'])->name('about');
+ $app->map('/contact', [$this, 'contact'])->via('GET', 'POST')->name('contact');
+ $app->get('/not-allowed', [$this, 'notAllowed'])->name('not-allowed');
+ $app->get('/assets', [$this, 'assets'])->name('assets');
}
public function index()
@@ -24,19 +24,19 @@ public function index()
: $this->application->request()->get('page');
$perPage = 10;
- $start = ($page -1) * $perPage;
+ $start = ($page - 1) * $perPage;
- $eventApi = $this->getEventApi();
+ $eventApi = $this->getEventApi();
$hotEvents = $eventApi->getEvents($perPage, $start, 'hot');
$cfpEvents = $eventApi->getEvents(4, 0, 'cfp', true);
$this->render(
'Application/index.html.twig',
- array(
- 'events' => $hotEvents,
+ [
+ 'events' => $hotEvents,
'cfp_events' => $cfpEvents,
- 'page' => $page,
- )
+ 'page' => $page,
+ ]
);
}
@@ -83,8 +83,8 @@ public function contact()
if ($form->isValid()) {
$values = $form->getData();
- $config = $this->application->config('oauth');
- $clientId = $config['client_id'];
+ $config = $this->application->config('oauth');
+ $clientId = $config['client_id'];
$clientSecret = $config['client_secret'];
try {
@@ -99,7 +99,7 @@ public function contact()
);
$this->application->flash('message', "Thank you for contacting us.");
$this->application->redirect($this->application->urlFor("contact"));
- } catch (\Exception $e) {
+ } catch (Exception $e) {
$this->application->flashNow('error', $e->getMessage());
}
}
@@ -126,13 +126,11 @@ public function assets()
);
}
-
/**
* Render the notAllowed page
*/
public function notAllowed()
{
-
$this->render('Application/not-allowed.html.twig', [
'redirect' => $this->application->request->get('redirect')
]);
diff --git a/app/src/Application/BaseApi.php b/app/src/Application/BaseApi.php
index 41f5e9dd5..84fa62fed 100644
--- a/app/src/Application/BaseApi.php
+++ b/app/src/Application/BaseApi.php
@@ -1,5 +1,7 @@
accessToken = $accessToken;
}
- protected function apiGet($url, $params = array())
+ protected function apiGet($url, $params = [])
{
$paramsString = count($params) ? '?' . http_build_query($params, '', '&') : '';
- $contextOpts = array('http' => array(
- 'header' => "Accept: application/json",
- 'timeout' => 10,
- 'ignore_errors' => true,
- ));
+ $contextOpts = [
+ 'http' => [
+ 'header' => "Accept: application/json",
+ 'timeout' => 10,
+ 'ignore_errors' => true,
+ ]
+ ];
// Forwarded header - see RFC 7239 (http://tools.ietf.org/html/rfc7239)
- $ip = $_SERVER['REMOTE_ADDR'];
+ $ip = $_SERVER['REMOTE_ADDR'];
$agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'unknown';
+
$contextOpts['http']['header'] .= "\r\nForwarded: for=$ip;user-agent=\"$agent\"";
if ($this->accessToken) {
@@ -40,33 +45,35 @@ protected function apiGet($url, $params = array())
}
if ($this->proxy) {
- $contextOpts['http']['proxy'] = $this->proxy;
+ $contextOpts['http']['proxy'] = $this->proxy;
$contextOpts['http']['request_fulluri'] = true;
}
$streamContext = stream_context_create($contextOpts);
- $result = file_get_contents($url . $paramsString, 0, $streamContext);
+ $result = file_get_contents($url . $paramsString, 0, $streamContext);
if (false === $result) {
- throw new \Exception('Unable to connect to API');
+ throw new Exception('Unable to connect to API');
}
return $result;
}
- protected function apiDelete($url, $params = array())
+ protected function apiDelete($url, $params = [])
{
$paramsString = count($params) ? '?' . http_build_query($params, '', '&') : '';
- $contextOpts = array('http' => array(
- 'method' => 'DELETE',
- 'header' => "Accept: application/json",
- 'timeout' => 10,
- 'ignore_errors' => true,
- ));
+ $contextOpts = [
+ 'http' => [
+ 'method' => 'DELETE',
+ 'header' => "Accept: application/json",
+ 'timeout' => 10,
+ 'ignore_errors' => true,
+ ]
+ ];
// Forwarded header - see RFC 7239 (http://tools.ietf.org/html/rfc7239)
- $ip = $_SERVER['REMOTE_ADDR'];
+ $ip = $_SERVER['REMOTE_ADDR'];
$agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'unknown';
$contextOpts['http']['header'] .= "\r\nForwarded: for=$ip;user-agent=\"$agent\"";
@@ -75,15 +82,15 @@ protected function apiDelete($url, $params = array())
}
if ($this->proxy) {
- $contextOpts['http']['proxy'] = $this->proxy;
+ $contextOpts['http']['proxy'] = $this->proxy;
$contextOpts['http']['request_fulluri'] = true;
}
$streamContext = stream_context_create($contextOpts);
- $result = file_get_contents($url . $paramsString, 0, $streamContext);
+ $result = file_get_contents($url . $paramsString, 0, $streamContext);
if (false === $result) {
- throw new \Exception('Unable to connect to API');
+ throw new Exception('Unable to connect to API');
}
$status = 0;
@@ -93,22 +100,24 @@ protected function apiDelete($url, $params = array())
$headers = $this->extractListOfHeaders($http_response_header);
- return array($status, $result, $headers);
+ return [$status, $result, $headers];
}
- protected function apiPost($url, $params = array())
+ protected function apiPost($url, $params = [])
{
- $contextOpts = array('http' => array(
- 'method' => 'POST',
- 'header' => "Content-type: application/json\r\n"
- . "Accept: application/json",
- 'content' => json_encode($params),
- 'timeout' => 10,
- 'ignore_errors' => true,
- ));
+ $contextOpts = [
+ 'http' => [
+ 'method' => 'POST',
+ 'header' => "Content-type: application/json\r\n"
+ . "Accept: application/json",
+ 'content' => json_encode($params),
+ 'timeout' => 10,
+ 'ignore_errors' => true,
+ ]
+ ];
// Forwarded header - see RFC 7239 (http://tools.ietf.org/html/rfc7239)
- $ip = $_SERVER['REMOTE_ADDR'];
+ $ip = $_SERVER['REMOTE_ADDR'];
$agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'unknown';
$contextOpts['http']['header'] .= "\r\nForwarded: for=$ip;user-agent=\"$agent\"";
@@ -117,14 +126,14 @@ protected function apiPost($url, $params = array())
}
if ($this->proxy) {
- $contextOpts['http']['proxy'] = $this->proxy;
+ $contextOpts['http']['proxy'] = $this->proxy;
$contextOpts['http']['request_fulluri'] = true;
}
$streamContext = stream_context_create($contextOpts);
- $result = file_get_contents($url, 0, $streamContext);
+ $result = file_get_contents($url, 0, $streamContext);
if (false === $result) {
- throw new \Exception('Unable to connect to API');
+ throw new Exception('Unable to connect to API');
}
$status = 0;
@@ -134,23 +143,26 @@ protected function apiPost($url, $params = array())
$headers = $this->extractListOfHeaders($http_response_header);
- return array($status, $result, $headers);
+ return [$status, $result, $headers];
}
- protected function apiPut($url, $params = array())
+ protected function apiPut($url, $params = [])
{
- $contextOpts = array('http' => array(
- 'method' => 'PUT',
- 'header' => "Content-type: application/json\r\n"
- . "Accept: application/json",
- 'content' => json_encode($params),
- 'timeout' => 10,
- 'ignore_errors' => true,
- ));
+ $contextOpts = [
+ 'http' => [
+ 'method' => 'PUT',
+ 'header' => "Content-type: application/json\r\n"
+ . "Accept: application/json",
+ 'content' => json_encode($params),
+ 'timeout' => 10,
+ 'ignore_errors' => true,
+ ]
+ ];
// Forwarded header - see RFC 7239 (http://tools.ietf.org/html/rfc7239)
- $ip = $_SERVER['REMOTE_ADDR'];
+ $ip = $_SERVER['REMOTE_ADDR'];
$agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'unknown';
+
$contextOpts['http']['header'] .= "\r\nForwarded: for=$ip;user-agent=\"$agent\"";
if ($this->accessToken) {
@@ -158,14 +170,14 @@ protected function apiPut($url, $params = array())
}
if ($this->proxy) {
- $contextOpts['http']['proxy'] = $this->proxy;
+ $contextOpts['http']['proxy'] = $this->proxy;
$contextOpts['http']['request_fulluri'] = true;
}
$streamContext = stream_context_create($contextOpts);
- $result = file_get_contents($url, 0, $streamContext);
+ $result = file_get_contents($url, 0, $streamContext);
if (false === $result) {
- throw new \Exception('Unable to connect to API');
+ throw new Exception('Unable to connect to API');
}
$status = 0;
@@ -175,7 +187,7 @@ protected function apiPut($url, $params = array())
$headers = $this->extractListOfHeaders($http_response_header);
- return array($status, $result, $headers);
+ return [$status, $result, $headers];
}
/**
@@ -191,7 +203,7 @@ protected function apiPut($url, $params = array())
*/
private function extractListOfHeaders(array $rawHeaders)
{
- $headers = array();
+ $headers = [];
foreach ($rawHeaders as $header) {
$header = explode(':', $header, 2);
if (count($header) < 2) {
@@ -205,7 +217,7 @@ private function extractListOfHeaders(array $rawHeaders)
}
/**
- * @param $access_token
+ * @param $accessToken
*/
public function setAccessToken($accessToken)
{
diff --git a/app/src/Application/BaseCommentEntity.php b/app/src/Application/BaseCommentEntity.php
index 1ce1e51c9..2ed532816 100644
--- a/app/src/Application/BaseCommentEntity.php
+++ b/app/src/Application/BaseCommentEntity.php
@@ -1,5 +1,5 @@
config('custom');
return $config;
}
- protected function render($template, $data = array(), $status = null)
+ protected function render($template, $data = [], $status = null)
{
try {
$this->application->render($template, $data, $status);
- } catch (Twig_Error_Runtime $e) {
+ } catch (RuntimeError $e) {
$this->application->render(
'Error/app_load_error.html.twig',
- array(
+ [
'message' => sprintf(
'An exception has been thrown during the rendering of a template ("%s").',
$e->getMessage()
@@ -46,7 +46,7 @@ protected function render($template, $data = array(), $status = null)
-1,
null,
$e
- )
+ ]
);
}
}
diff --git a/app/src/Application/BaseDb.php b/app/src/Application/BaseDb.php
index 2a3eb5c95..7c4111da9 100644
--- a/app/src/Application/BaseDb.php
+++ b/app/src/Application/BaseDb.php
@@ -1,5 +1,5 @@
keyPrefix = $keyPrefix;
- $this->client = $client;
+ $this->client = $client;
}
public function save($collection, $data, $keyField, $keyValue)
diff --git a/app/src/Application/Config.php b/app/src/Application/Config.php
index c1c8c7a08..3dbdd79bc 100644
--- a/app/src/Application/Config.php
+++ b/app/src/Application/Config.php
@@ -1,6 +1,6 @@
baseApiUrl . '/v2.1/contact';
- $params = array(
+
+ $params = [
'client_id' => $clientId,
'client_secret' => $clientSecret,
'name' => $name,
'email' => $email,
'subject' => $subject,
'comment' => $comment,
- );
+ ];
list($status, $result) = $this->apiPost($url, $params);
@@ -24,7 +22,7 @@ public function contact($name, $email, $subject, $comment, $clientId, $clientSec
return true;
}
- $result = json_decode($result);
+ $result = json_decode($result);
$message = $result[0];
throw new \Exception("Failed: " . $message);
diff --git a/app/src/Application/ContactFormType.php b/app/src/Application/ContactFormType.php
index 246d4f5ee..378c7480f 100644
--- a/app/src/Application/ContactFormType.php
+++ b/app/src/Application/ContactFormType.php
@@ -1,12 +1,12 @@
add(
'name',
- 'text',
+ TextType::class,
[
'constraints' => [new Assert\NotBlank(), new Assert\Length(['max' => 100])],
- 'max_length' => '100',
+ 'max_length' => '100',
]
)
->add(
'email',
- 'text',
+ TextType::class,
[
- 'required' => true,
+ 'required' => true,
'constraints' => [new Assert\NotBlank(), new Assert\Email()],
]
)
->add(
'subject',
- 'text',
+ TextType::class,
[
'constraints' => [new Assert\NotBlank(), new Assert\Length(['max' => 100])],
- 'max_length' => '100',
+ 'max_length' => '100',
]
)
->add(
'comment',
- 'textarea',
+ TextareaType::class,
[
- 'required' => true,
+ 'required' => true,
'constraints' => [new Assert\NotBlank()],
]
)
->add(
'phone',
- 'text',
+ TextType::class,
[
'constraints' => [new Assert\Blank()],
]
diff --git a/app/src/Client/ClientApi.php b/app/src/Client/ClientApi.php
index 7476f79e2..cc430e0cc 100644
--- a/app/src/Client/ClientApi.php
+++ b/app/src/Client/ClientApi.php
@@ -1,8 +1,7 @@
'yes'])
public function submit(array $data)
{
$values = [
- 'name' => $data['application'],
- 'description' => $data['description'],
+ 'name' => $data['application'],
+ 'description' => $data['description'],
'callback_url' => $data['callback_url'],
];
- list ($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/applications', $values);
+ list($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/applications', $values);
if ($status != 201) {
$decoded = json_decode($result);
@@ -96,11 +95,11 @@ public function submit(array $data)
public function editClient($clientUri, array $data)
{
$values = [
- 'name' => $data['application'],
- 'description' => $data['description'],
+ 'name' => $data['application'],
+ 'description' => $data['description'],
'callback_url' => $data['callback_url'],
];
- list ($status, $result, $headers) = $this->apiPut($clientUri, $values);
+ list($status, $result, $headers) = $this->apiPut($clientUri, $values);
if ($status != 201) {
$decoded = json_decode($result);
@@ -121,7 +120,7 @@ public function editClient($clientUri, array $data)
*/
public function deleteClient($clientUri)
{
- list ($status, $result, $headers) = $this->apiDelete($clientUri);
+ list($status, $result, $headers) = $this->apiDelete($clientUri);
if ($status != 204) {
$decoded = json_decode($result);
diff --git a/app/src/Client/ClientController.php b/app/src/Client/ClientController.php
index bbc577741..b099cf942 100644
--- a/app/src/Client/ClientController.php
+++ b/app/src/Client/ClientController.php
@@ -1,7 +1,7 @@
get('/user/:username/client', array($this, 'index'))->name('clients');
- $app->map('/user/:username/client/create', array($this, 'createClient'))->via('GET', 'POST')->name('client-create');
- $app->get('/user/:username/client/:clientName', array($this, 'showClient'))->name('client-show');
- $app->map('/user/:username/client/:clientName/edit', array($this, 'editClient'))->via('GET', 'POST')->name('client-edit');
- $app->get('/user/:username/client/:clientName/delete', array($this, 'deleteClient'))->via('GET', 'POST')->name('client-delete');
+ $app->get('/user/:username/client', [$this, 'index'])
+ ->name('clients');
+ $app->map('/user/:username/client/create', [$this, 'createClient'])
+ ->via('GET', 'POST')
+ ->name('client-create');
+ $app->get('/user/:username/client/:clientName', [$this, 'showClient'])
+ ->name('client-show');
+ $app->map('/user/:username/client/:clientName/edit', [$this, 'editClient'])
+ ->via('GET', 'POST')
+ ->name('client-edit');
+ $app->get('/user/:username/client/:clientName/delete', [$this, 'deleteClient'])
+ ->via('GET', 'POST')
+ ->name('client-delete');
}
public function index($username)
@@ -37,11 +45,11 @@ public function index($username)
}
$clientApi = $this->getClientApi();
- $clients = $clientApi->getCollection([]);
+ $clients = $clientApi->getCollection([]);
$this->render('Client/index.html.twig', [
'clients' => $clients['clients'],
- 'user' => $_SESSION['user'],
+ 'user' => $_SESSION['user'],
]);
}
@@ -49,7 +57,7 @@ public function showClient($username, $clientName)
{
$thisUrl = $this->application->urlFor('client-show', [
'clientName' => $clientName,
- 'username' => $username,
+ 'username' => $username,
]);
if (!isset($_SESSION['user'])) {
@@ -74,7 +82,7 @@ public function showClient($username, $clientName)
$this->render('Client/details.html.twig', [
'client' => $client,
- 'user' => $_SESSION['user']
+ 'user' => $_SESSION['user']
]);
}
@@ -116,11 +124,11 @@ public function createClient($username)
$this->render(
'Client/submit.html.twig',
[
- 'form' => $form->createView(),
+ 'form' => $form->createView(),
'backUri' => $this->application->urlFor('clients', [
'username' => $username,
]),
- 'user' => $_SESSION['user']
+ 'user' => $_SESSION['user']
]
);
}
@@ -153,14 +161,15 @@ public function editClient($username, $clientName)
}
// default values
- $data = [];
- $data['application'] = $client->getName();
- $data['description'] = $client->getDescription();
- $data['callback_url'] = $client->getCallbackUrl();
+ $data = [
+ 'application' => $client->getName(),
+ 'description' => $client->getDescription(),
+ 'callback_url' => $client->getCallbackUrl()
+ ];
/** @var FormFactoryInterface $factory */
$factory = $this->application->formFactory;
- $form = $factory->create(new ClientFormType(), $data);
+ $form = $factory->create(new ClientFormType(), $data);
$request = $this->application->request();
if ($request->isPost()) {
@@ -190,13 +199,13 @@ public function editClient($username, $clientName)
$this->render(
'Client/edit-client.html.twig',
[
- 'client' => $client,
- 'form' => $form->createView(),
+ 'client' => $client,
+ 'form' => $form->createView(),
'backUri' => $this->application->urlFor('client-show', [
'clientName' => $client->getId(),
'username' => $username,
]),
- 'user' => $_SESSION['user'],
+ 'user' => $_SESSION['user'],
]
);
}
@@ -215,7 +224,7 @@ public function editClient($username, $clientName)
private function addClientUsingForm(Form $form)
{
$clientApi = $this->getClientApi();
- $values = $form->getData();
+ $values = $form->getData();
$result = false;
try {
@@ -259,11 +268,10 @@ public function deleteClient($username, $clientName)
}
// default values
- $data = [];
- $data['client_id'] = $client->getId();
+ $data = ['client_id' => $client->getId()];
$factory = $this->application->formFactory;
- $form = $factory->create(new ClientDeleteFormType(), $data);
+ $form = $factory->create(new ClientDeleteFormType(), $data);
$request = $this->application->request();
@@ -293,13 +301,13 @@ public function deleteClient($username, $clientName)
$this->render(
'Client/delete-client.html.twig',
[
- 'client' => $client,
- 'form' => $form->createView(),
+ 'client' => $client,
+ 'form' => $form->createView(),
'backUri' => $this->application->urlFor('client-show', [
'clientName' => $client->getId(),
'username' => $username
]),
- 'user' => $_SESSION['user']
+ 'user' => $_SESSION['user']
]
);
}
diff --git a/app/src/Client/ClientDeleteFormType.php b/app/src/Client/ClientDeleteFormType.php
index fad56f961..8e0b5ac69 100644
--- a/app/src/Client/ClientDeleteFormType.php
+++ b/app/src/Client/ClientDeleteFormType.php
@@ -1,11 +1,10 @@
add(
'client_id',
- 'hidden',
+ HiddenType::class,
[]
)
;
diff --git a/app/src/Client/ClientEntity.php b/app/src/Client/ClientEntity.php
index b666c6ec0..a66c198a4 100644
--- a/app/src/Client/ClientEntity.php
+++ b/app/src/Client/ClientEntity.php
@@ -1,9 +1,7 @@
add(
'application',
- 'text',
+ TextType::class,
[
'constraints' => [new Assert\NotBlank()],
]
)
->add(
'description',
- 'textarea',
+ TextareaType::class,
[
'constraints' => [new Assert\NotBlank()],
- 'attr'=> ['rows' => '10']
+ 'attr' => ['rows' => '10']
]
)
->add(
'callback_url',
- 'url',
+ UrlType::class,
[
'constraints' => [
new Assert\Url(),
diff --git a/app/src/Event/Constraint/ValidEventIcon.php b/app/src/Event/Constraint/ValidEventIcon.php
index d7bbd5221..244b5b760 100644
--- a/app/src/Event/Constraint/ValidEventIcon.php
+++ b/app/src/Event/Constraint/ValidEventIcon.php
@@ -1,5 +1,5 @@
groupname;
- $keyName = $constraint->keyname;
+ $keyName = $constraint->keyname;
$files = $_FILES;
if ($groupName) {
@@ -27,7 +27,7 @@ public function validate($value, Constraint $constraint)
$filename = $files['name'][$keyName];
// we have a file - is it valid?
$contents = file_get_contents($files['tmp_name'][$keyName]);
- $image = @imagecreatefromstring($contents);
+ $image = @imagecreatefromstring($contents);
if ($image === false) {
$this->context->buildViolation("'%filename%' is not a recognised image file")
->setParameter('%filename%', $filename)
@@ -35,7 +35,7 @@ public function validate($value, Constraint $constraint)
return;
}
- $width = imagesx($image);
+ $width = imagesx($image);
$height = imagesy($image);
if ($width !== $height) {
imagedestroy($image);
diff --git a/app/src/Event/EventApi.php b/app/src/Event/EventApi.php
index 7557e3d84..ac296be1d 100644
--- a/app/src/Event/EventApi.php
+++ b/app/src/Event/EventApi.php
@@ -1,13 +1,16 @@
baseApiUrl . '/v2.1/events';
+
$queryParams['resultsperpage'] = $limit;
- $queryParams['start'] = $start;
+ $queryParams['start'] = $start;
if ($filter) {
$queryParams['filter'] = $filter;
@@ -61,7 +65,7 @@ public function getEvents($limit = 10, $start = 1, $filter = null, $verbose = fa
* and return us an event
*
* @param string $friendlyUrl The nice url bit of the event (e.g. phpbenelux-conference-2014)
- * @return EventEntity The event we found, or false if something went wrong
+ * @return EventEntity|bool The event we found, or false if something went wrong
*/
public function getByFriendlyUrl($friendlyUrl)
{
@@ -80,7 +84,7 @@ public function getByFriendlyUrl($friendlyUrl)
* and return us an event
*
* @param string $stub The short url bit of the event (e.g. phpbnl14)
- * @return EventEntity The event we found, or false if something went wrong
+ * @return EventEntity|bool The event we found, or false if something went wrong
*/
public function getByStub($stub)
{
@@ -102,7 +106,7 @@ public function getByStub($stub)
*/
public function getEvent($event_uri, $verbose = true)
{
- $params = array();
+ $params = [];
if ($verbose) {
$params['verbose'] = 'yes';
}
@@ -127,13 +131,13 @@ public function getEvent($event_uri, $verbose = true)
* Get an event by id
*
* @param integer $eventId
- * @return EventEntity
+ * @return EventEntity|null
*/
public function getEventById($eventId)
{
$eventId = (int)$eventId;
if (!$eventId) {
- return;
+ return null;
}
$eventUrl = $this->baseApiUrl . '/v2.1/events/' . $eventId;
@@ -145,7 +149,7 @@ public function getEventById($eventId)
* Get comments for given event
* @param $comment_uri
* @param bool $verbose
- * @return EventCommentEntity[]
+ * @return array|EventCommentEntity[]
*/
public function getComments($comment_uri, $verbose = false)
{
@@ -155,7 +159,7 @@ public function getComments($comment_uri, $verbose = false)
$comments = (array)json_decode($this->apiGet($comment_uri));
- $commentData = array();
+ $commentData = [];
foreach ($comments['comments'] as $comment) {
$commentData[] = new EventCommentEntity($comment);
@@ -164,14 +168,14 @@ public function getComments($comment_uri, $verbose = false)
return $commentData;
}
- public function addComment($event, $comment, $rating = 0)
+ public function addComment(EventEntity $event, $comment, $rating = 0)
{
- $uri = $event->getCommentsUri();
- $params = array(
+ $uri = $event->getCommentsUri();
+ $params = [
'comment' => $comment,
- 'rating' => $rating,
- );
- list ($status, $result) = $this->apiPost($uri, $params);
+ 'rating' => $rating,
+ ];
+ list($status, $result) = $this->apiPost($uri, $params);
if ($status == 201) {
return true;
@@ -181,7 +185,7 @@ public function addComment($event, $comment, $rating = 0)
public function reportComment($uri)
{
- list ($status, $result) = $this->apiPost($uri);
+ list($status, $result) = $this->apiPost($uri);
if ($status == 202) {
return true;
@@ -191,7 +195,7 @@ public function reportComment($uri)
public function attend(EventEntity $event)
{
- list ($status, $result) = $this->apiPost($event->getApiUriToMarkAsAttending());
+ list($status, $result) = $this->apiPost($event->getApiUriToMarkAsAttending());
if ($status == 201) {
return true;
@@ -202,7 +206,7 @@ public function attend(EventEntity $event)
public function unattend(EventEntity $event)
{
- list ($status, $result) = $this->apiDelete($event->getApiUriToMarkAsAttending());
+ list($status, $result) = $this->apiDelete($event->getApiUriToMarkAsAttending());
if ($status == 200) {
return true;
@@ -221,16 +225,14 @@ public function unattend(EventEntity $event)
*/
public function getAttendees($attendees_uri, $limit = 0, $verbose = false)
{
-
$attendees_uri .= "?resultsperpage={$limit}";
if ($verbose) {
$attendees_uri = $attendees_uri . '&verbose=yes';
}
-
$attendees = (array)json_decode($this->apiGet($attendees_uri));
- $attendeeData = array();
+ $attendeeData = [];
foreach ($attendees['users'] as $attendee) {
$attendeeData[] = new UserEntity($attendee);
@@ -254,7 +256,7 @@ public function getAttendees($attendees_uri, $limit = 0, $verbose = false)
public function submit(array $data)
{
// Convert datetime objects to strings
- $dateFields = array('start_date', 'end_date', 'cfp_start_date', 'cfp_end_date');
+ $dateFields = ['start_date', 'end_date', 'cfp_start_date', 'cfp_end_date'];
foreach ($dateFields as $dateField) {
if (isset($data[$dateField]) && $data[$dateField] instanceof DateTime) {
$data[$dateField] = $data[$dateField]->format('Y-m-d');
@@ -266,7 +268,7 @@ public function submit(array $data)
}
}
- list ($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/events', $data);
+ list($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/events', $data);
// if successful, return event entity represented by the URL in the Location header
if ($status == 201) {
@@ -300,7 +302,7 @@ public function submit(array $data)
public function edit(array $data)
{
// Convert datetime objects to strings
- $dateFields = array('start_date', 'end_date', 'cfp_start_date', 'cfp_end_date');
+ $dateFields = ['start_date', 'end_date', 'cfp_start_date', 'cfp_end_date'];
foreach ($dateFields as $dateField) {
if (isset($data[$dateField]) && $data[$dateField] instanceof DateTime) {
$data[$dateField] = $data[$dateField]->format('c');
@@ -313,7 +315,7 @@ public function edit(array $data)
}
- list ($status, $result, $headers) = $this->apiPut($data['uri'], $data);
+ list($status, $result, $headers) = $this->apiPut($data['uri'], $data);
// if successful, return event entity represented by the URL in the Location header
if ($status == 204) {
$response = $this->getCollection($headers['location']);
@@ -335,20 +337,22 @@ public function edit(array $data)
public function uploadIcon($imagesUri, $fileName)
{
try {
- $client = new \GuzzleHttp\Client([
+ $client = new Client([
"timeout" => 10,
]);
$headers = [];
- $headers["Accept"] = "application/json";
+
+ $headers["Accept"] = "application/json";
$headers["Authorization"] = "OAuth {$this->accessToken}";
// Forwarded header - see RFC 7239 (http://tools.ietf.org/html/rfc7239)
- $ip = $_SERVER['REMOTE_ADDR'];
- $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'unknown';
+ $ip = $_SERVER['REMOTE_ADDR'];
+ $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'unknown';
$headers["Forwarded"] = "for=$ip;user-agent=\"$agent\"";
$options = [];
+
$options['headers'] = $headers;
if ($this->proxy) {
@@ -356,12 +360,16 @@ public function uploadIcon($imagesUri, $fileName)
}
// now add the file itself
- $options['multipart'] = [['name' => 'image',
- 'contents' => fopen($fileName, 'r')]];
-
- $request = new \GuzzleHttp\Psr7\Request('POST', $imagesUri);
+ $options['multipart'] = [
+ [
+ 'name' => 'image',
+ 'contents' => fopen($fileName, 'r')
+ ]
+ ];
+
+ $request = new Request('POST', $imagesUri);
$response = $client->send($request, $options);
- } catch (\GuzzleHttp\Exception\RequestException $e) {
+ } catch (RequestException $e) {
$body = $e->getResponse()->getBody();
error_log($e->getMessage());
error_log(json_decode($body)[0]);
@@ -387,12 +395,12 @@ public function uploadIcon($imagesUri, $fileName)
*
* @return array
*/
- public function getCollection($uri, array $queryParams = array())
+ public function getCollection($uri, array $queryParams = [])
{
$events = (array)json_decode($this->apiGet($uri, $queryParams));
$meta = array_pop($events);
- $collectionData = array();
+ $collectionData = [];
foreach ($events['events'] as $item) {
$event = new EventEntity($item);
@@ -437,7 +445,7 @@ public function getTalkComments($comment_uri, $limit = 10, $start = 1, $verbose
$meta = array_pop($comments);
- $commentData = array();
+ $commentData = [];
foreach ($comments['comments'] as $item) {
if (isset($item->user_uri)) {
@@ -459,7 +467,7 @@ public function getTalkComments($comment_uri, $limit = 10, $start = 1, $verbose
*/
public function approveEvent($approval_uri)
{
- list ($status, $result, $headers) = $this->apiPost($approval_uri);
+ list($status, $result, $headers) = $this->apiPost($approval_uri);
if ($status == 204) {
return true;
@@ -475,7 +483,7 @@ public function approveEvent($approval_uri)
*/
public function rejectEvent($approval_uri)
{
- list ($status, $result, $headers) = $this->apiDelete($approval_uri);
+ list($status, $result, $headers) = $this->apiDelete($approval_uri);
if ($status == 204) {
return true;
@@ -502,7 +510,7 @@ public function getPendingClaims($claims_uri, $verbose = false)
$claims_uri = $claims_uri . "?verbose=yes";
}
$response = json_decode($this->apiGet($claims_uri));
-
+
$reports = [];
foreach ($response->claims as $item) {
@@ -538,7 +546,7 @@ public function moderateComment($reported_uri, $decision)
{
$data['decision'] = $decision;
- list ($status, $result, $headers) = $this->apiPut($reported_uri, $data);
+ list($status, $result, $headers) = $this->apiPut($reported_uri, $data);
// if successful, return event entity represented by the URL in the Location header
if ($status == 204) {
diff --git a/app/src/Event/EventCommentEntity.php b/app/src/Event/EventCommentEntity.php
index 5f984d045..3bd77c158 100644
--- a/app/src/Event/EventCommentEntity.php
+++ b/app/src/Event/EventCommentEntity.php
@@ -1,7 +1,7 @@
itemsPerPage = 10;
+ $this->itemsPerPage = 10;
$this->pendingItemsPerPage = 30;
}
protected function defineRoutes(Slim $app)
{
// named routes first; should an event pick the same name then at least our actions take precedence
- $app->get('/event', array($this, 'index'))->name("events-index");
- $app->get('/event/pending', array($this, 'pending'))->name("events-pending");
- $app->map('/event/submit', array($this, 'submit'))->via('GET', 'POST')->name('event-submit');
- $app->get('/event/callforpapers', array($this, 'callForPapers'))->name('event-call-for-papers');
- $app->get('/event/:friendly_name', array($this, 'eventDefault'))->name("event-default");
- $app->get('/event/:friendly_name/details', array($this, 'details'))->name("event-detail");
- $app->get('/event/:friendly_name/attendees', array($this, 'attendees'))->name("event-attendees");
- $app->get('/event/:friendly_name/slides', array($this, 'slides'))->name("event-slides");
- $app->get('/event/:friendly_name/comments', array($this, 'comments'))->name("event-comments");
- $app->get('/event/:friendly_name/comments/:comment_hash/report', array($this, 'reportComment'))
+ $app->get('/event', [$this, 'index'])
+ ->name("events-index");
+ $app->get('/event/pending', [$this, 'pending'])
+ ->name("events-pending");
+ $app->map('/event/submit', [$this, 'submit'])
+ ->via('GET', 'POST')
+ ->name('event-submit');
+ $app->get('/event/callforpapers', [$this, 'callForPapers'])
+ ->name('event-call-for-papers');
+ $app->get('/event/:friendly_name', [$this, 'eventDefault'])
+ ->name("event-default");
+ $app->get('/event/:friendly_name/details', [$this, 'details'])
+ ->name("event-detail");
+ $app->get('/event/:friendly_name/attendees', [$this, 'attendees'])
+ ->name("event-attendees");
+ $app->get('/event/:friendly_name/slides', [$this, 'slides'])
+ ->name("event-slides");
+ $app->get('/event/:friendly_name/comments', [$this, 'comments'])
+ ->name("event-comments");
+ $app->get('/event/:friendly_name/comments/:comment_hash/report', [$this, 'reportComment'])
->name("event-comments-reported");
- $app->get('/event/:friendly_name/schedule', array($this, 'schedule'))->name("event-schedule");
- $app->get('/event/:friendly_name/schedule/list(/:starred)', array($this, 'scheduleList'))->name("event-schedule-list");
- $app->get('/event/:friendly_name/schedule/grid(/:starred)', array($this, 'scheduleGrid'))->name("event-schedule-grid");
- $app->get('/event/:friendly_name/talk-comments', array($this, 'talkComments'))->name("event-talk-comments");
- $app->post('/event/:friendly_name/add-comment', array($this, 'addComment'))->name('event-add-comment');
- $app->map('/event/:friendly_name/edit', array($this, 'edit'))->via('GET', 'POST')->name('event-edit');
- $app->get('/e/:stub', array($this, 'quicklink'))->name("event-quicklink");
- $app->get('/event/xhr-attend/:friendly_name', array($this, 'xhrAttend'));
- $app->get('/event/xhr-unattend/:friendly_name', array($this, 'xhrUnattend'));
- $app->get('/event/attend/:friendly_name', array($this, 'attend'))->name("event-attend");
- $app->get('/event/unattend/:friendly_name', array($this, 'unattend'))->name("event-unattend");
- $app->post('/event/action-pending-event/:friendly_name', array($this, 'actionPendingEvent'))
+ $app->get('/event/:friendly_name/schedule', [$this, 'schedule'])
+ ->name("event-schedule");
+ $app->get('/event/:friendly_name/schedule/list(/:starred)', [$this, 'scheduleList'])
+ ->name("event-schedule-list");
+ $app->get('/event/:friendly_name/schedule/grid(/:starred)', [$this, 'scheduleGrid'])
+ ->name("event-schedule-grid");
+ $app->get('/event/:friendly_name/talk-comments', [$this, 'talkComments'])
+ ->name("event-talk-comments");
+ $app->post('/event/:friendly_name/add-comment', [$this, 'addComment'])
+ ->name('event-add-comment');
+ $app->map('/event/:friendly_name/edit', [$this, 'edit'])
+ ->via('GET', 'POST')
+ ->name('event-edit');
+ $app->get('/e/:stub', [$this, 'quicklink'])
+ ->name("event-quicklink");
+ $app->get('/event/xhr-attend/:friendly_name', [$this, 'xhrAttend']);
+ $app->get('/event/xhr-unattend/:friendly_name', [$this, 'xhrUnattend']);
+ $app->get('/event/attend/:friendly_name', [$this, 'attend'])
+ ->name("event-attend");
+ $app->get('/event/unattend/:friendly_name', [$this, 'unattend'])
+ ->name("event-unattend");
+ $app->post('/event/action-pending-event/:friendly_name', [$this, 'actionPendingEvent'])
->name("event-action-pending");
- $app->get('/event/view/:eventId(/:extra+)', array($this, 'redirectFromId'))
+ $app->get('/event/view/:eventId(/:extra+)', [$this, 'redirectFromId'])
->name('event-redirect-from-id')
- ->conditions(array('eventId' => '\d+'));
- $app->get('/event/:friendly_name/reported-comments', array($this, 'reportedComments'))
+ ->conditions(['eventId' => '\d+']);
+ $app->get('/event/:friendly_name/reported-comments', [$this, 'reportedComments'])
->name("event-reported-comments");
- $app->post('/event/:friendly_name/moderate-comment', array($this, 'moderateComment'))
+ $app->post('/event/:friendly_name/moderate-comment', [$this, 'moderateComment'])
->name("event-moderate-comment");
- $app->map('/event/:friendly_name/add-talk', array($this, 'addTalk'))->via('GET', 'POST')
+ $app->map('/event/:friendly_name/add-talk', [$this, 'addTalk'])
+ ->via('GET', 'POST')
->name("event-add-talk");
- $app->map('/event/:friendly_name/edit-tracks', array($this, 'editTracks'))->via('GET', 'POST')
+ $app->map('/event/:friendly_name/edit-tracks', [$this, 'editTracks'])
+ ->via('GET', 'POST')
->name("event-edit-tracks");
- $app->map('/event/:friendly_name/claims', array($this, 'talkClaims'))->via('GET', 'POST')
+ $app->map('/event/:friendly_name/claims', [$this, 'talkClaims'])
+ ->via('GET', 'POST')
->name("event-talk-claims");
}
public function index()
{
$start = null;
- $page = (int)$this->application->request()->get('page');
+ $page = (int)$this->application->request()->get('page');
if (array_key_exists('events_list_middle_start', $_SESSION) && $page !== 0) {
// use the middle start point that we've remembered, unless it's page zero,
@@ -84,12 +105,12 @@ public function index()
if ($start < 0) {
$this->itemsPerPage = $start + $this->itemsPerPage;
- $start = 0;
+ $start = 0;
}
}
$eventApi = $this->getEventApi();
- $events = $eventApi->getEvents($this->itemsPerPage, $start, 'all');
+ $events = $eventApi->getEvents($this->itemsPerPage, $start, 'all');
if ($start === null) {
// Find out the start number that has been sent back to us by the API
if (isset($events['pagination'])) {
@@ -105,11 +126,11 @@ public function index()
$this->render(
'Event/index.html.twig',
- array(
- 'page' => $page,
+ [
+ 'page' => $page,
'cfp_events' => $cfpEvents,
- 'events' => $events
- )
+ 'events' => $events
+ ]
);
}
@@ -127,7 +148,7 @@ public function pending()
$start = ($page -1) * $this->pendingItemsPerPage;
$eventApi = $this->getEventApi();
- $events = $eventApi->getEvents(
+ $events = $eventApi->getEvents(
$this->pendingItemsPerPage,
$start,
'pending',
@@ -136,10 +157,10 @@ public function pending()
$this->render(
'Event/pending.html.twig',
- array(
- 'page' => $page,
+ [
+ 'page' => $page,
'events' => $events
- )
+ ]
);
}
@@ -151,7 +172,7 @@ public function callForPapers()
$start = ($page -1) * $this->itemsPerPage;
$eventApi = $this->getEventApi();
- $events = $eventApi->getEvents(
+ $events = $eventApi->getEvents(
$this->itemsPerPage,
$start,
'cfp',
@@ -160,10 +181,10 @@ public function callForPapers()
$this->render(
'Event/call-for-papers.html.twig',
- array(
- 'page' => $page,
+ [
+ 'page' => $page,
'events' => $events,
- )
+ ]
);
}
@@ -208,18 +229,18 @@ public function details($friendly_name)
}
$quicklink = $this->application->request()->headers("host")
- . $this->application->urlFor('event-quicklink', array('stub' => $event->getStub()));
+ . $this->application->urlFor('event-quicklink', ['stub' => $event->getStub()]);
$attendees = $eventApi->getAttendees($event->getAttendeesUri(), 6, true);
$this->render(
'Event/details.html.twig',
- array(
- 'event' => $event,
+ [
+ 'event' => $event,
'quicklink' => $quicklink,
'attendees' => $attendees
- )
+ ]
);
}
@@ -237,11 +258,11 @@ public function attendees($friendly_name)
$this->render(
'Event/_common/event_attendees.html.twig',
- array(
+ [
'event' => $event,
'fullList' => true,
'attendees' => $attendees
- )
+ ]
);
}
@@ -254,16 +275,16 @@ public function comments($friendly_name)
}
$quicklink = $this->application->request()->headers("host")
- . $this->application->urlFor('event-quicklink', array('stub' => $event->getStub()));
+ . $this->application->urlFor('event-quicklink', ['stub' => $event->getStub()]);
$comments = $eventApi->getComments($event->getCommentsUri(), true);
$this->render(
'Event/comments.html.twig',
- array(
- 'event' => $event,
+ [
+ 'event' => $event,
'quicklink' => $quicklink,
- 'comments' => $comments,
- )
+ 'comments' => $comments,
+ ]
);
}
@@ -275,7 +296,7 @@ public function talkComments($friendly_name)
$start = ($page -1) * $this->itemsPerPage;
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if ($event) {
$comments = $eventApi->getTalkComments(
@@ -286,19 +307,19 @@ public function talkComments($friendly_name)
);
// If we have comments, fetch talk slugs for the talks so that we can create links to them in the template
- $slugs = array();
+ $slugs = [];
if (array_key_exists('comments', $comments) && $comments['pagination']->count > 0) {
$slugs = $this->getTalkSlugsForTalkComments($comments['comments'], $event);
}
$this->render(
'Event/talk-comments.html.twig',
- array(
- 'event' => $event,
- 'page' => $page,
+ [
+ 'event' => $event,
+ 'page' => $page,
'talkComments' => $comments,
- 'talkSlugs' => $slugs,
- )
+ 'talkSlugs' => $slugs,
+ ]
);
} else {
$events_url = $this->application->urlFor("events-index");
@@ -322,7 +343,7 @@ public function schedule($friendly_name)
public function slides($friendly_name)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if (! $event) {
$this->redirectToListPage();
@@ -330,16 +351,16 @@ public function slides($friendly_name)
$agenda = $this->getTalkApi()->getAgenda($event->getTalksUri());
- $this->render('Event/slides.html.twig', array(
- 'event' => $event,
+ $this->render('Event/slides.html.twig', [
+ 'event' => $event,
'agenda' => $agenda,
- ));
+ ]);
}
public function scheduleList($friendly_name, $starred = false)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if (! $event) {
$this->redirectToListPage();
@@ -349,8 +370,8 @@ public function scheduleList($friendly_name, $starred = false)
$agenda = $this->getTalkApi()->getAgenda($event->getTalksUri());
- $request = $this->application->request();
- $starredOnly = ($starred === 'starred');
+ $request = $this->application->request();
+ $starredOnly = ($starred === 'starred');
$currentUrlWithoutStarred = str_replace('/starred', '', $request->getResourceUri());
@@ -360,19 +381,19 @@ public function scheduleList($friendly_name, $starred = false)
$currentUrlWithoutStarred .= $expectedUrlSuffix;
}
- $this->render('Event/schedule-list.html.twig', array(
- 'event' => $event,
- 'agenda' => $agenda,
- 'starred' => $starred,
+ $this->render('Event/schedule-list.html.twig', [
+ 'event' => $event,
+ 'agenda' => $agenda,
+ 'starred' => $starred,
'starred_only' => $starredOnly,
- 'current_url' => $currentUrlWithoutStarred
- ));
+ 'current_url' => $currentUrlWithoutStarred
+ ]);
}
public function scheduleGrid($friendly_name, $starred = false)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if (! $event) {
$this->redirectToListPage();
@@ -380,13 +401,13 @@ public function scheduleGrid($friendly_name, $starred = false)
setcookie('schedule-view', 'grid', strtotime('+2 years'), '/');
- $talkApi = $this->getTalkApi();
+ $talkApi = $this->getTalkApi();
$scheduler = new EventScheduler($talkApi);
$schedule = $scheduler->getScheduleData($event);
- $request = $this->application->request();
- $starredOnly = ($starred === 'starred');
+ $request = $this->application->request();
+ $starredOnly = ($starred === 'starred');
$currentUrlWithoutStarred = str_replace('/starred', '', $request->getResourceUri());
// Does it end in /schedule/grid or are we on the default event page
@@ -395,19 +416,19 @@ public function scheduleGrid($friendly_name, $starred = false)
$currentUrlWithoutStarred .= $expectedUrlSuffix;
}
- $this->render('Event/schedule-grid.html.twig', array(
- 'event' => $event,
- 'eventDays' => $schedule,
- 'starred' => $starred,
+ $this->render('Event/schedule-grid.html.twig', [
+ 'event' => $event,
+ 'eventDays' => $schedule,
+ 'starred' => $starred,
'starred_only' => $starredOnly,
- 'current_url' => $currentUrlWithoutStarred
- ));
+ 'current_url' => $currentUrlWithoutStarred
+ ]);
}
public function quicklink($stub)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByStub($stub);
+ $event = $eventApi->getByStub($stub);
if (! $event) {
$this->redirectToListPage();
}
@@ -419,12 +440,12 @@ public function addComment($friendly_name)
{
$request = $this->application->request();
$comment = $request->post('comment');
- $rating = (int) $request->post('rating');
- $url = $this->application->urlFor("event-comments", array('friendly_name' => $friendly_name));
- $url .= '#add-comment';
+ $rating = (int)$request->post('rating');
+ $url = $this->application->urlFor("event-comments", ['friendly_name' => $friendly_name]);
+ $url .= '#add-comment';
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if ($event) {
try {
$eventApi->addComment($event, $comment, $rating);
@@ -455,8 +476,8 @@ public function addComment($friendly_name)
public function reportComment($friendly_name, $comment_hash)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
- $url = $this->application->urlFor("event-comments", array('friendly_name' => $friendly_name));
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $url = $this->application->urlFor("event-comments", ['friendly_name' => $friendly_name]);
$comments = $eventApi->getComments($event->getCommentsUri());
foreach ($comments as $comment) {
@@ -486,7 +507,7 @@ public function reportComment($friendly_name, $comment_hash)
public function attend($friendly_name)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if ($event) {
$eventApi->attend($event, $_SESSION['user']);
@@ -503,7 +524,7 @@ public function attend($friendly_name)
public function unattend($friendly_name)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if ($event) {
$eventApi->unattend($event, $_SESSION['user']);
@@ -552,10 +573,10 @@ public function submit()
$this->render(
'Event/submit.html.twig',
- array(
+ [
'form' => $form->createView(),
'timezones' => EventFormType::getNestedListOfTimezones(),
- )
+ ]
);
}
@@ -594,11 +615,11 @@ public function edit($friendly_name)
$this->render(
'Event/edit.html.twig',
- array(
+ [
'event' => $event,
'form' => $form->createView(),
'timezones' => EventFormType::getNestedListOfTimezones(),
- )
+ ]
);
}
@@ -650,7 +671,7 @@ public function actionPendingEvent($friendly_name)
public function redirectFromId($eventId, $extra = false)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getEventById($eventId);
+ $event = $eventApi->getEventById($eventId);
if (!$event) {
return Slim::getInstance()->notFound();
}
@@ -659,28 +680,32 @@ public function redirectFromId($eventId, $extra = false)
$this->application->redirect(
$this->application->urlFor(
'event-talk-comments',
- array('friendly_name' => $event->getUrlFriendlyName())
+ ['friendly_name' => $event->getUrlFriendlyName()]
)
);
- } if ($extra && is_array($extra) && ($extra[0] == "comments")) {
+ }
+
+ if ($extra && is_array($extra) && ($extra[0] == "comments")) {
$this->application->redirect(
$this->application->urlFor(
'event-comments',
- array('friendly_name' => $event->getUrlFriendlyName())
+ ['friendly_name' => $event->getUrlFriendlyName()]
)
);
- } if ($extra && is_array($extra) && ($extra[0] == "talks")) {
+ }
+
+ if ($extra && is_array($extra) && ($extra[0] == "talks")) {
$this->application->redirect(
$this->application->urlFor(
'event-schedule',
- array('friendly_name' => $event->getUrlFriendlyName())
+ ['friendly_name' => $event->getUrlFriendlyName()]
)
);
} else {
$this->application->redirect(
$this->application->urlFor(
'event-default',
- array('friendly_name' => $event->getUrlFriendlyName())
+ ['friendly_name' => $event->getUrlFriendlyName()]
)
);
}
@@ -692,14 +717,14 @@ public function redirectFromId($eventId, $extra = false)
*
* Should an error occur will this method append an error message to the form's error collection.
*
- * @param Form $form
+ * @param FormInterface $form
*
* @return EventEntity|null|false
*/
- private function addEventUsingForm(Form $form)
+ private function addEventUsingForm(FormInterface $form)
{
$eventApi = $this->getEventApi();
- $values = $form->getData();
+ $values = $form->getData();
$result = false;
try {
@@ -719,14 +744,14 @@ private function addEventUsingForm(Form $form)
*
* Should an error occur will this method append an error message to the form's error collection.
*
- * @param Form $form
+ * @param FormInterface $form
*
* @return EventEntity|null|false
*/
- private function editEventUsingForm(Form $form)
+ private function editEventUsingForm(FormInterface $form)
{
$eventApi = $this->getEventApi();
- $values = $form->getData()->toArray();
+ $values = $form->getData()->toArray();
$result = false;
try {
@@ -746,8 +771,8 @@ private function editEventUsingForm(Form $form)
);
}
} catch (\Exception $e) {
- $result = false;
- $error = $e->getMessage();
+ $result = false;
+ $error = $e->getMessage();
$messages = json_decode($error);
if ($messages) {
$error = implode(', ', $messages);
@@ -762,8 +787,8 @@ private function editEventUsingForm(Form $form)
protected function getEventApi()
{
- $cache = $this->getCache();
- $eventDb = new EventDb($cache);
+ $cache = $this->getCache();
+ $eventDb = new EventDb($cache);
$eventApi = new EventApi($this->cfg, $this->accessToken, $eventDb, $this->getUserApi());
return $eventApi;
@@ -813,7 +838,7 @@ private function redirectToListPage()
private function redirectToDetailPage($friendlyName, $status = 302)
{
$this->application->redirect(
- $this->application->urlFor('event-detail', array('friendly_name' => $friendlyName)),
+ $this->application->urlFor('event-detail', ['friendly_name' => $friendlyName]),
$status
);
}
@@ -822,34 +847,34 @@ public function xhrAttend($friendly_name)
{
$this->application->response()->header('Content-Type', 'application/json');
- $api = $this->getEventApi();
+ $api = $this->getEventApi();
$event = $api->getByFriendlyUrl($friendly_name);
if ($event) {
$result = $this->getEventApi()->attend($event, $_SESSION['user']);
}
- $this->application->response()->body(json_encode(array('success' => $result)));
+ $this->application->response()->body(json_encode(['success' => $result]));
}
public function xhrUnattend($friendly_name)
{
$this->application->response()->header('Content-Type', 'application/json');
- $api = $this->getEventApi();
+ $api = $this->getEventApi();
$event = $api->getByFriendlyUrl($friendly_name);
if ($event) {
$result = $this->getEventApi()->unattend($event, $_SESSION['user']);
}
- $this->application->response()->body(json_encode(array('success' => $result)));
+ $this->application->response()->body(json_encode(['success' => $result]));
}
public function reportedComments($friendly_name)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if ($event) {
if (! $event->getCanEdit()) {
@@ -866,11 +891,11 @@ public function reportedComments($friendly_name)
$this->render(
'Event/reported-comments.html.twig',
- array(
- 'event' => $event,
+ [
+ 'event' => $event,
'eventComments' => $eventComments,
'talkComments' => $talkComments,
- )
+ ]
);
} else {
$events_url = $this->application->urlFor("events-index");
@@ -895,14 +920,14 @@ public function moderateComment($friendly_name)
}
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if ($event) {
if (! $event->getCanEdit()) {
$this->redirectToDetailPage($event->getUrlFriendlyName());
}
$reported_uri = $this->application->request->post('reported_uri');
- $decision = $this->application->request->post('decision');
+ $decision = $this->application->request->post('decision');
$eventApi->moderateComment($reported_uri, $decision);
if ($decision == 'approved') {
@@ -924,9 +949,8 @@ public function talkClaims($friendly_name)
);
}
-
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if ($event) {
if (!$event->getCanEdit()) {
@@ -943,7 +967,7 @@ public function talkClaims($friendly_name)
foreach ($claims as &$claim) {
$claim->user = $userApi->getUser($claim->speaker_uri);
$claim->talk = $talkApi->getTalk($claim->talk_uri);
- $action = $this->application->request->post('action');
+ $action = $this->application->request->post('action');
if ($this->application->request->post('display_name')
&& $this->application->request->post('display_name') == $claim->display_name
@@ -956,7 +980,7 @@ public function talkClaims($friendly_name)
];
if ($action == "approve") {
- $this->appoveClaimPendingTalk($talkApi, $claim, $data);
+ $this->approveClaimPendingTalk($talkApi, $claim, $data);
} elseif ($action == "reject") {
$this->rejectClaimPendingTalk($talkApi, $claim, $data);
}
@@ -965,14 +989,15 @@ public function talkClaims($friendly_name)
$this->render(
'Event/pending-claims.html.twig',
- array(
- 'event' => $event,
+ [
+ 'event' => $event,
'claims' => $claims,
- )
+ ]
);
}
}
- private function appoveClaimPendingTalk($talkApi, $claim, $data)
+
+ private function approveClaimPendingTalk(TalkApi $talkApi, $claim, $data)
{
$talkApi->claimTalk($claim->approve_claim_uri, $data);
@@ -982,7 +1007,7 @@ private function appoveClaimPendingTalk($talkApi, $claim, $data)
/**
* Reject a talk claim
*/
- private function rejectClaimPendingTalk($talkApi, $claim, $data)
+ private function rejectClaimPendingTalk(TalkApi $talkApi, $claim, $data)
{
$talkApi->rejectTalkClaim($claim->approve_claim_uri, $data);
@@ -997,7 +1022,7 @@ private function rejectClaimPendingTalk($talkApi, $claim, $data)
public function addTalk($friendly_name)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if (!$event) {
return Slim::getInstance()->notFound();
}
@@ -1007,13 +1032,13 @@ public function addTalk($friendly_name)
}
$languageApi = $this->getLanguageApi();
- $languages = $languageApi->getLanguagesChoiceList();
+ $languages = $languageApi->getLanguagesChoiceList();
$talkTypeApi = $this->getTalkTypeApi();
- $talkTypes = $talkTypeApi->getTalkTypesChoiceList();
+ $talkTypes = $talkTypeApi->getTalkTypesChoiceList();
$trackApi = $this->getTrackApi();
- $tracks = $trackApi->getTracksChoiceList($event->getTracksUri());
+ $tracks = $trackApi->getTracksChoiceList($event->getTracksUri());
// default values
$sessionKeys = ['duration', 'language', 'type', 'track'];
@@ -1024,7 +1049,7 @@ public function addTalk($friendly_name)
/** @var FormFactoryInterface $factory */
$factory = $this->application->formFactory;
- $form = $factory->create(new TalkFormType($event, $languages, $talkTypes, $tracks), $data);
+ $form = $factory->create(new TalkFormType($event, $languages, $talkTypes, $tracks), $data);
$request = $this->application->request();
if ($request->isPost()) {
@@ -1040,7 +1065,7 @@ public function addTalk($friendly_name)
try {
$talkApi = $this->getTalkApi();
- $talk = $talkApi->addTalk($event->getTalksUri(), $values);
+ $talk = $talkApi->addTalk($event->getTalksUri(), $values);
if (!empty($values['track']) && isset($tracks[$values['track']])) {
$talkApi->addTalkToTrack($talk->getTracksUri(), $values['track']);
@@ -1060,10 +1085,10 @@ public function addTalk($friendly_name)
$this->render(
'Event/add-talk.html.twig',
- array(
+ [
'event' => $event,
- 'form' => $form->createView(),
- )
+ 'form' => $form->createView(),
+ ]
);
}
@@ -1075,7 +1100,7 @@ public function addTalk($friendly_name)
public function editTracks($friendly_name)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($friendly_name);
+ $event = $eventApi->getByFriendlyUrl($friendly_name);
if (!$event) {
return Slim::getInstance()->notFound();
}
@@ -1084,8 +1109,8 @@ public function editTracks($friendly_name)
$this->redirectToDetailPage($event->getUrlFriendlyName());
}
- $trackApi = $this->getTrackApi();
- $tracks = $trackApi->getTracks($event->getTracksUri());
+ $trackApi = $this->getTrackApi();
+ $tracks = $trackApi->getTracks($event->getTracksUri());
$numberOfTracks = 0;
if ($tracks && $tracks['meta']['count']) {
$data['tracks'] = $tracks['tracks'];
@@ -1094,8 +1119,9 @@ public function editTracks($friendly_name)
$data['tracks'][] = [];
}
+ /** @var FormFactoryInterface $factory */
$factory = $this->application->formFactory;
- $form = $factory->create(new TrackCollectionFormType(), $data);
+ $form = $factory->create(new TrackCollectionFormType(), $data);
$request = $this->application->request();
if ($request->isPost()) {
@@ -1105,7 +1131,7 @@ public function editTracks($friendly_name)
$values = $form->getdata();
try {
- $eventTracksUri = $event->getTracksUri();
+ $eventTracksUri = $event->getTracksUri();
$updatedTrackUris = [];
foreach ($values['tracks'] as $item) {
if ($item['uri']) {
@@ -1129,7 +1155,7 @@ public function editTracks($friendly_name)
$this->application->redirect(
$this->application->urlFor(
'event-edit-tracks',
- array('friendly_name' => $event->getUrlFriendlyName())
+ ['friendly_name' => $event->getUrlFriendlyName()]
)
);
} catch (\Exception $e) {
@@ -1142,10 +1168,10 @@ public function editTracks($friendly_name)
$this->render(
'Event/edit-tracks.html.twig',
- array(
+ [
'event' => $event,
- 'form' => $form->createView(),
- )
+ 'form' => $form->createView(),
+ ]
);
}
@@ -1174,9 +1200,9 @@ private function getTalkSlugsForTalkComments(array $comments, EventEntity $event
private function getTalkSlugsFromDb(array $comments)
{
$talkDb = $this->getTalkDb();
- $slugs = array();
+ $slugs = [];
- /** @var \Talk\TalkCommentEntity $comment */
+ /** @var \JoindIn\Web\Talk\TalkCommentEntity $comment */
foreach ($comments as $comment) {
$slugs[$comment->getTalkUri()] = $talkDb->getSlugFor($comment->getTalkUri());
}
@@ -1185,8 +1211,9 @@ private function getTalkSlugsFromDb(array $comments)
}
/**
- * @param array $slugs
* @param EventEntity $event
+ *
+ * @return array
*/
private function getTalkSlugsFromApi(EventEntity $event)
{
@@ -1195,10 +1222,11 @@ private function getTalkSlugsFromApi(EventEntity $event)
// Fetch talks from the API
$talks = $talkApi->getCollection(
$event->getTalksUri(),
- array('resultsperpage' => 100) // Make sure we get all talks with a single request
+ ['resultsperpage' => 100] // Make sure we get all talks with a single request
);
- /** @var \Talk\TalkEntity $talk */
+ $slugs = [];
+ /** @var \JoindIn\Web\Talk\TalkEntity $talk */
foreach ($talks['talks'] as $talk) {
$slugs[$talk->getApiUri()] = $talk->getUrlFriendlyTalkTitle();
}
diff --git a/app/src/Event/EventDb.php b/app/src/Event/EventDb.php
index 8675ab98e..e1db1847b 100644
--- a/app/src/Event/EventDb.php
+++ b/app/src/Event/EventDb.php
@@ -1,8 +1,8 @@
$event->getUrlFriendlyName(),
- "uri" => $event->getUri(),
- "stub" => $event->getStub(),
- "verbose_uri" => $event->getVerboseUri(),
- "name" => $event->getName(),
- );
+ "uri" => $event->getUri(),
+ "stub" => $event->getStub(),
+ "verbose_uri" => $event->getVerboseUri(),
+ "name" => $event->getName(),
+ ];
$this->cache->save($this->keyName, $data, 'uri', $event->getUri());
$this->cache->save($this->keyName, $data, 'url_friendly_name', $event->getUrlFriendlyName());
diff --git a/app/src/Event/EventEntity.php b/app/src/Event/EventEntity.php
index fcd4af3b3..33d72fb0d 100644
--- a/app/src/Event/EventEntity.php
+++ b/app/src/Event/EventEntity.php
@@ -1,8 +1,8 @@
getEndDate());
- $now = new DateTime(null, $endDate->getTimezone());
+ $now = new DateTime(null, $endDate->getTimezone());
$now->setTime(0, 0, 0);
return ($endDate < $now);
@@ -449,7 +449,8 @@ public function getCfpStatus()
{
if (!empty($this->getCfpStartDate()) && !empty($this->getCfpEndDate())) {
$startDate = DateTime::createFromFormat(DateTime::ISO8601, $this->getCfpStartDate());
- $endDate = DateTime::createFromFormat(DateTime::ISO8601, $this->getCfpEndDate());
+ $endDate = DateTime::createFromFormat(DateTime::ISO8601, $this->getCfpEndDate());
+
$now = new DateTime(null, $endDate->getTimezone());
$now->setTime(0, 0, 0);
diff --git a/app/src/Event/EventFormType.php b/app/src/Event/EventFormType.php
index 3f8f2f6ae..908cf4cb6 100644
--- a/app/src/Event/EventFormType.php
+++ b/app/src/Event/EventFormType.php
@@ -1,12 +1,19 @@
getListOfTimezoneContinentsAndCities();
+ list($continents, $cities) = $this->getListOfTimezoneContinentsAndCities();
$timezone = null;
if (isset($options['data'])) {
@@ -65,17 +71,17 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$dateTransformer = new DateTransformer($timezone);
$builder
- ->add('addr', 'hidden', ['mapped' => false])
+ ->add('addr', HiddenType::class, ['mapped' => false])
->add(
'name',
- 'text',
+ TextType::class,
[
'constraints' => [new Assert\NotBlank(), new Assert\Length(['min' => 5])],
]
)
->add(
'description',
- 'textarea',
+ TextareaType::class,
[
'constraints' => [new Assert\NotBlank(), new Assert\Length(['min' => 5])],
'attr' => [
@@ -86,96 +92,96 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add(
$builder->create(
'tags',
- 'text',
+ TextType::class,
[
'required' => false,
- 'attr' => ['placeholder' => 'comma separated, tag, list']
+ 'attr' => ['placeholder' => 'comma separated, tag, list']
]
)->addViewTransformer(new EventTagsTransformer())
)
->add(
'tz_continent',
- 'choice',
+ ChoiceType::class,
[
'label' => 'Timezone',
- 'choices' => array("Select a continent") + $continents,
+ 'choices' => array_merge(["Select a continent"], $continents),
'constraints' => [new Assert\NotBlank()],
]
)
->add(
'tz_place',
- 'choice',
+ ChoiceType::class,
[
'label' => 'Timezone city',
- 'choices' => array('Select a city') + $cities,
+ 'choices' => array_merge(['Select a city'], $cities),
'constraints' => [new Assert\NotBlank()],
]
)
->add(
$builder->create(
'start_date',
- 'text',
+ TextType::class,
$this->getOptionsForDateWidget('Start date')
)->addViewTransformer($dateTransformer)
)
->add(
$builder->create(
'end_date',
- 'text',
+ TextType::class,
$this->getOptionsForDateWidget('End date')
)->addViewTransformer($dateTransformer)
)
- ->add('href', 'url', $this->getOptionsForUrlWidget('Website URL'))
+ ->add('href', UrlType::class, $this->getOptionsForUrlWidget('Website URL'))
->add(
$builder->create(
'cfp_start_date',
- 'text',
+ TextType::class,
$this->getOptionsForDateWidget('Opening date', false)
)->addViewTransformer($dateTransformer)
)
->add(
$builder->create(
'cfp_end_date',
- 'text',
+ TextType::class,
$this->getOptionsForDateWidget('Closing date', false)
)->addViewTransformer($dateTransformer)
)
- ->add('cfp_url', 'url', $this->getOptionsForUrlWidget('Call for papers URL', false))
+ ->add('cfp_url', UrlType::class, $this->getOptionsForUrlWidget('Call for papers URL', false))
->add(
'location',
- 'text',
+ TextType::class,
[
- 'label' => 'Venue name',
+ 'label' => 'Venue name',
'constraints' => [new Assert\NotBlank()],
]
)
->add(
'latitude',
- 'text',
+ TextType::class,
[
'label' => 'Latitude',
- 'attr' => ['readonly' => 'readonly'],
+ 'attr' => ['readonly' => 'readonly'],
]
)
->add(
'longitude',
- 'text',
+ TextType::class,
[
'label' => 'Longitude',
- 'attr' => ['readonly' => 'readonly'],
+ 'attr' => ['readonly' => 'readonly'],
]
)
->add(
'new_icon',
- 'file',
+ FileType::class,
[
- 'data_class' => null,
- 'label' => 'Upload new icon',
- 'required' => false,
- 'attr'=> [
- 'class'=>'file',
+ 'data_class' => null,
+ 'label' => 'Upload new icon',
+ 'required' => false,
+ 'attr' => [
+ 'class' => 'file',
],
- 'constraints' => [new Constraint\ValidEventIcon(['groupname' => 'event', 'keyname'=>'new_icon'])],
+ 'constraints' => [new ValidEventIcon(['groupname' => 'event', 'keyname' => 'new_icon'])],
]
)
;
@@ -262,13 +268,16 @@ public function getListOfTimezoneContinentsAndCities()
$timezones = \DateTimeZone::listIdentifiers();
array_pop($timezones); // Remove UTC from the end of the list
+ $continents = [];
+ $cities = [];
+
foreach ($timezones as $timezone) {
list($continent, $city) = explode('/', $timezone, 2);
$continents[$continent] = $continent;
- $cities[$city] = $city;
+ $cities[$city] = $city;
}
- return array($continents, $cities);
+ return [$continents, $cities];
}
/**
@@ -284,10 +293,10 @@ public static function getNestedListOfTimezones()
$timezones = \DateTimeZone::listIdentifiers();
array_pop($timezones); // Remove UTC from the end of the list
- $result = array();
+ $result = [];
foreach ($timezones as $timezone) {
list($continent, $city) = explode('/', $timezone, 2);
- $result[$continent][] = $city;
+ $result[$continent][] = $city;
}
foreach ($result as $continent => $cities) {
diff --git a/app/src/Event/EventScheduler.php b/app/src/Event/EventScheduler.php
index 3afd2d706..3ccd3d5d9 100644
--- a/app/src/Event/EventScheduler.php
+++ b/app/src/Event/EventScheduler.php
@@ -1,7 +1,8 @@
getTalks($event->getTalksUri().'?start=0&resultsperpage=1000');
+ $talks = $this->getTalks($event->getTalksUri() . '?start=0&resultsperpage=1000');
$eventDays = $this->getEventDays($talks);
return $eventDays;
@@ -43,7 +44,7 @@ public function getScheduleData(EventEntity $event)
/**
* Retrieves talk collection from API
*
- * @param $talks_uri
+ * @param string $talks_uri
* @return array
*/
public function getTalks($talks_uri)
@@ -56,21 +57,21 @@ public function getTalks($talks_uri)
/**
* Get an array of populated EventSchedulerDay objects
*
- * @param $talks
+ * @param array|TalkEntity[] $talks
* @return array Array of EventSchedulerDay objects
*/
public function getEventDays($talks)
{
if (empty($talks) || empty($talks['talks'])) {
- return array();
+ return [];
}
- $talks = $talks['talks'];
+ $talks = $talks['talks'];
$talksByDay = $this->organiseTalksByDayAndTime($talks);
$tracksByDay = $this->getTracksByDay($talks);
- $eventDays = array();
+ $eventDays = [];
foreach ($talksByDay as $date => $talks) {
$eventDays[] = new EventSchedulerDay($date, $talks, $tracksByDay[$date]);
}
@@ -83,23 +84,23 @@ public function getEventDays($talks)
* associative array by day, then by time for each
* day
*
- * @param $talks
+ * @param array|TalkEntity[] $talks
* @return array
*/
protected function organiseTalksByDayAndTime($talks)
{
- $talksByDay = array();
+ $talksByDay = [];
foreach ($talks as $talk) {
$dateTime = $talk->getStartDateTime();
- $date = $dateTime->format('d-m-Y');
- $time = $dateTime->format('H:i');
+ $date = $dateTime->format('d-m-Y');
+ $time = $dateTime->format('H:i');
if (!isset($talksByDay[$date]) || !array_key_exists($date, $talksByDay)) {
- $talksByDay[$date] = array();
+ $talksByDay[$date] = [];
}
if (!isset($talksByDay[$date][$time]) || !array_key_exists($time, $talksByDay[$date])) {
- $talksByDay[$date][$time] = array();
+ $talksByDay[$date][$time] = [];
}
$talksByDay[$date][$time][] = $talk;
@@ -112,19 +113,19 @@ protected function organiseTalksByDayAndTime($talks)
* Get a multi-dimensional indexed array of unique
* track names by date
*
- * @param $talks
+ * @param array|TalkEntity[] $talks
* @return array
*/
protected function getTracksByDay($talks)
{
- $tracksByDay = array();
+ $tracksByDay = [];
foreach ($talks as $talk) {
$dateTime = $talk->getStartDateTime();
- $date = $dateTime->format('d-m-Y');
+ $date = $dateTime->format('d-m-Y');
if (!isset($tracksByDay[$date]) || !array_key_exists($date, $tracksByDay)) {
- $tracksByDay[$date] = array();
+ $tracksByDay[$date] = [];
}
$tracks = $talk->getTracks();
diff --git a/app/src/Event/EventSchedulerDay.php b/app/src/Event/EventSchedulerDay.php
index 9c3e97c30..6c53cfce6 100644
--- a/app/src/Event/EventSchedulerDay.php
+++ b/app/src/Event/EventSchedulerDay.php
@@ -1,5 +1,5 @@
date = $date;
- $this->talks = $talks;
+ $this->date = $date;
+ $this->talks = $talks;
$this->tracks = $tracks;
}
@@ -55,7 +55,7 @@ public function getDate()
/**
* Get talks
*
- * @return Array
+ * @return array
*/
public function getTalks()
{
@@ -65,7 +65,7 @@ public function getTalks()
/**
* Get tracks
*
- * @return Array
+ * @return array
*/
public function getTracks()
{
diff --git a/app/src/Event/TrackApi.php b/app/src/Event/TrackApi.php
index d39cb8bcb..ebf16b2ed 100644
--- a/app/src/Event/TrackApi.php
+++ b/app/src/Event/TrackApi.php
@@ -1,7 +1,7 @@
$data['track_name'],
+ 'track_name' => $data['track_name'],
'track_description' => $data['track_description'],
];
@@ -57,7 +57,7 @@ public function updateTrack($trackUri, $data)
return true;
}
- $result = json_decode($result);
+ $result = json_decode($result);
$message = $result[0];
throw new \Exception("Failed: " . $message);
@@ -72,7 +72,7 @@ public function updateTrack($trackUri, $data)
public function addTrack($eventTracksUri, $data)
{
$params = [
- 'track_name' => $data['track_name'],
+ 'track_name' => $data['track_name'],
'track_description' => $data['track_description'],
];
@@ -81,7 +81,7 @@ public function addTrack($eventTracksUri, $data)
return true;
}
- $result = json_decode($result);
+ $result = json_decode($result);
$message = $result[0];
throw new \Exception("Failed: " . $message);
@@ -91,7 +91,6 @@ public function addTrack($eventTracksUri, $data)
* Delete a track
*
* @param string $trackUri
- * @param array $data
*/
public function deleteTrack($trackUri)
{
@@ -100,7 +99,7 @@ public function deleteTrack($trackUri)
return true;
}
- $result = json_decode($result);
+ $result = json_decode($result);
$message = $result[0];
throw new \Exception("Failed to delete track: " . $message);
diff --git a/app/src/Event/TrackCollectionFormType.php b/app/src/Event/TrackCollectionFormType.php
index d9b95f8be..3671ca590 100644
--- a/app/src/Event/TrackCollectionFormType.php
+++ b/app/src/Event/TrackCollectionFormType.php
@@ -1,10 +1,10 @@
add(
'tracks',
- 'collection',
+ CollectionType::class,
[
- 'type' => new TrackFormType(),
- 'allow_add' => true,
+ 'type' => new TrackFormType(),
+ 'allow_add' => true,
'allow_delete' => true,
]
)
diff --git a/app/src/Event/TrackFormType.php b/app/src/Event/TrackFormType.php
index 2b6129c81..26d71fd36 100644
--- a/app/src/Event/TrackFormType.php
+++ b/app/src/Event/TrackFormType.php
@@ -1,8 +1,11 @@
add(
'uri',
- 'hidden',
+ HiddenType::class,
[
'required' => false,
]
)
->add(
'track_name',
- 'text',
+ TextType::class,
[
'constraints' => [new Assert\NotBlank()],
]
)
->add(
'track_description',
- 'textarea',
+ TextareaType::class,
[
'constraints' => [new Assert\NotBlank()],
- 'attr'=> ['rows' => '2']
+ 'attr' => ['rows' => '2']
]
)
;
diff --git a/app/src/Form/DataTransformer/DateTransformer.php b/app/src/Form/DataTransformer/DateTransformer.php
index a5d2f7ff5..a10756fb6 100644
--- a/app/src/Form/DataTransformer/DateTransformer.php
+++ b/app/src/Form/DataTransformer/DateTransformer.php
@@ -1,9 +1,9 @@
baseApiUrl . '/v2.1/languages';
+
$queryParams['resultsperpage'] = 0;
$result = $this->apiGet($url, $queryParams);
diff --git a/app/src/Middleware/FormMiddleware.php b/app/src/Middleware/FormMiddleware.php
index 1b21301d0..0753c2dea 100644
--- a/app/src/Middleware/FormMiddleware.php
+++ b/app/src/Middleware/FormMiddleware.php
@@ -1,6 +1,6 @@
app->container->singleton(
self::SERVICE_FORM_FACTORY,
function () use ($formMiddleWare, $csrfSecret) {
- return $formMiddleWare->createFormFactory($csrfSecret);
+ return $formMiddleWare->createFormFactory();
}
);
@@ -98,16 +105,22 @@ function () use ($formMiddleWare, $csrfSecret) {
* Generally this method does not need to be called directly; it is used in a callback that created a shared
* instance in the container of Slim.
*
- * @param string $csrfSecret
- *
+ * @return FormFactoryInterface
+ * @throws \ReflectionException
* @see self::call() where this method is used to construct a shared instance in Slim.
*
- * @return FormFactoryInterface
*/
- public function createFormFactory($csrfSecret)
+ public function createFormFactory()
{
$builder = Forms::createFormFactoryBuilder()
- ->addExtension(new CsrfExtension(new DefaultCsrfProvider($csrfSecret)))
+ ->addExtension(
+ new CsrfExtension(
+ new CsrfTokenManager(
+ new UriSafeTokenGenerator(),
+ new NativeSessionTokenStorage()
+ )
+ )
+ )
->setResolvedTypeFactory(new ResolvedFormTypeFactory());
if ($this->app->validator) {
@@ -131,8 +144,8 @@ public function createFormFactory($csrfSecret)
private function getChainingLoader($env)
{
$loader = $env->getLoader();
- if (!$loader instanceof \Twig_Loader_Chain) {
- $loader = new \Twig_Loader_Chain(array($loader));
+ if (!$loader instanceof ChainLoader) {
+ $loader = new ChainLoader([$loader]);
$env->setLoader($loader);
}
@@ -142,15 +155,16 @@ private function getChainingLoader($env)
/**
* Adds a loader to Twig pointing to the location of the default templates for forms.
*
- * @param \Twig_Loader_Chain $loader
+ * @param ChainLoader $loader
*
* @return void
+ * @throws \ReflectionException
*/
- private function addFormTemplatesFolderToLoader(\Twig_Loader_Chain $loader)
+ private function addFormTemplatesFolderToLoader(ChainLoader $loader)
{
- $reflected = new \ReflectionClass('Symfony\Bridge\Twig\Extension\FormExtension');
- $path = dirname($reflected->getFileName()) . '/../Resources/views/Form';
- $loader->addLoader(new \Twig_Loader_Filesystem($path));
+ $reflected = new \ReflectionClass(FormExtension::class);
+ $path = dirname($reflected->getFileName()) . '/../Resources/views/Form';
+ $loader->addLoader(new FilesystemLoader($path));
}
/**
@@ -162,7 +176,7 @@ private function addFormTemplatesFolderToLoader(\Twig_Loader_Chain $loader)
*/
private function createFormTwigExtension($formLayoutTemplate)
{
- return new FormExtension(new TwigRenderer(new TwigRendererEngine(array($formLayoutTemplate))));
+ return new FormExtension(new TwigRenderer(new TwigRendererEngine([$formLayoutTemplate])));
}
/**
@@ -193,13 +207,14 @@ private function getTwigEnvironment()
* @param FormFactoryBuilder $builder
*
* @return void
+ * @throws \ReflectionException
*/
protected function addValidatorExtensionToFactoryBuilder(FormFactoryBuilder $builder)
{
$builder->addExtension(new ValidatorExtension($this->app->validator));
if (isset($this->app->translator)) {
- $r = new \ReflectionClass('Symfony\Component\Form\Form');
+ $r = new \ReflectionClass(Form::class);
$this->app->translator->addResource(
'xliff',
dirname($r->getFilename()) . '/Resources/translations/validators.' . $this->locale . '.xlf',
diff --git a/app/src/Middleware/ValidationMiddleware.php b/app/src/Middleware/ValidationMiddleware.php
index 81ff60ab0..02d2d57d5 100644
--- a/app/src/Middleware/ValidationMiddleware.php
+++ b/app/src/Middleware/ValidationMiddleware.php
@@ -1,6 +1,6 @@
setMetadataFactory(new ClassMetadataFactory(new StaticMethodLoader()))
- ->setConstraintValidatorFactory(new ConstraintValidatorFactory($this->app, array()))
- ->setTranslator($this->getTranslator())
- ->setApiVersion(Validation::API_VERSION_2_5)
- ->getValidator();
+ ->setMetadataFactory(new LazyLoadingMetadataFactory(new StaticMethodLoader()))
+ ->setConstraintValidatorFactory(new ConstraintValidatorFactory())
+ ->setTranslator($this->getTranslator())
+ ->getValidator();
return $validator;
}
@@ -129,7 +128,7 @@ private function getTranslator()
*/
private function getTranslationsRootFolder()
{
- $r = new \ReflectionClass('Symfony\Component\Validator\Validator');
+ $r = new \ReflectionClass(ValidatorInterface::class);
return dirname($r->getFilename());
}
diff --git a/app/src/Search/SearchController.php b/app/src/Search/SearchController.php
index c297b91db..9940ae9eb 100644
--- a/app/src/Search/SearchController.php
+++ b/app/src/Search/SearchController.php
@@ -1,15 +1,11 @@
get('/search/events', array($this, 'searchEvents'))->name("search-events");
- $app->get('/search', array($this, 'search'))->name("search");
+ $app->get('/search/events', [$this, 'searchEvents'])
+ ->name("search-events");
+ $app->get('/search', [$this, 'search'])
+ ->name("search");
}
/**
@@ -73,10 +71,9 @@ protected function sanitizeTag($tag)
*/
public function searchEvents()
{
-
$keyword = $this->sanitizeKeyword($this->application->request()->get('keyword'));
- $tag = $this->sanitizeTag($this->application->request()->get('tag'));
- $events = array();
+ $tag = $this->sanitizeTag($this->application->request()->get('tag'));
+ $events = [];
$page = ((int)$this->application->request()->get('page') === 0)
? 1
@@ -88,12 +85,12 @@ public function searchEvents()
$this->render(
'Event/search.html.twig',
- array(
+ [
'events' => $events,
'page' => $page,
'keyword' => $keyword,
'tag' => $tag
- )
+ ]
);
}
@@ -102,12 +99,12 @@ public function searchEvents()
*/
public function search()
{
- $keyword = $this->sanitizeKeyword($this->application->request()->get('keyword'));
- $events = array();
- $talks = array();
- $users = array();
- $eventInfo = array();
- $pagination = array();
+ $keyword = $this->sanitizeKeyword($this->application->request()->get('keyword'));
+ $events = [];
+ $talks = [];
+ $users = [];
+ $eventInfo = [];
+ $pagination = [];
$page = ((int)$this->application->request()->get('page') === 0)
? 1
@@ -115,8 +112,8 @@ public function search()
if (!empty($keyword)) {
$events = $this->searchEventsByTitleAndTag($page, $keyword);
- $talks = $this->searchTalksByTitle($page, $keyword);
- $users = $this->searchUsersByKeyword($page, $keyword);
+ $talks = $this->searchTalksByTitle($page, $keyword);
+ $users = $this->searchUsersByKeyword($page, $keyword);
// combine pagination data for events and talks
$pagination = $this->combinePaginationData(
@@ -130,7 +127,7 @@ public function search()
$this->render(
'Application/search.html.twig',
- array(
+ [
'events' => $events,
'eventInfo' => $eventInfo,
'talks' => $talks,
@@ -138,7 +135,7 @@ public function search()
'page' => $page,
'pagination' => $pagination,
'keyword' => $keyword
- )
+ ]
);
}
@@ -151,7 +148,7 @@ public function search()
*/
private function searchEventsByTitleAndTag($page, $keyword, $tag = null)
{
- $apiQueryParams = array();
+ $apiQueryParams = [];
if (!empty($keyword)) {
$apiQueryParams['title'] = $keyword;
@@ -181,9 +178,9 @@ private function searchEventsByTitleAndTag($page, $keyword, $tag = null)
private function searchTalksByTitle($page, $keyword)
{
$apiQueryParams = [
- 'title' => $keyword,
+ 'title' => $keyword,
'resultsperpage' => $this->itemsPerPage,
- 'start' => ($page - 1) * $this->itemsPerPage
+ 'start' => ($page - 1) * $this->itemsPerPage
];
return $this->getTalkApi()->getCollection(
@@ -201,10 +198,10 @@ private function searchTalksByTitle($page, $keyword)
private function searchUsersByKeyword($page, $keyword)
{
$apiQueryParams = [
- 'keyword' => $keyword,
+ 'keyword' => $keyword,
'resultsperpage' => $this->itemsPerPage,
- 'start' => ($page - 1) * $this->itemsPerPage,
- 'verbose' => 'yes'
+ 'start' => ($page - 1) * $this->itemsPerPage,
+ 'verbose' => 'yes'
];
return $this->getUserApi()->getCollection($apiQueryParams);
@@ -245,7 +242,7 @@ private function getEventInfoForTalks(array $talks)
$events = [];
foreach ($talks as $talk) {
- $eventUri = $talk->getEventUri();
+ $eventUri = $talk->getEventUri();
$events[$eventUri] = $eventApi->getEvent($eventUri);
}
diff --git a/app/src/Talk/SpeakerFormType.php b/app/src/Talk/SpeakerFormType.php
index ed306e549..548c8f638 100644
--- a/app/src/Talk/SpeakerFormType.php
+++ b/app/src/Talk/SpeakerFormType.php
@@ -1,11 +1,10 @@
add('name', 'text', [
- 'label' => false,
+ ->add('name', TextType::class, [
+ 'label' => false,
'required' => false,
- ])
- ;
+ ]);
}
}
diff --git a/app/src/Talk/TalkApi.php b/app/src/Talk/TalkApi.php
index 40a024c04..739493da0 100644
--- a/app/src/Talk/TalkApi.php
+++ b/app/src/Talk/TalkApi.php
@@ -1,9 +1,9 @@
talkDb = $talkDb;
+ $this->talkDb = $talkDb;
$this->userApi = $userApi;
}
@@ -46,7 +46,7 @@ public function getCollection($talks_uri, array $queryParams = [])
);
$meta = array_pop($talks);
- $collectionData = array();
+ $collectionData = [];
foreach ($talks['talks'] as $item) {
$talk = new TalkEntity($item);
@@ -148,7 +148,7 @@ public function getComments($comment_uri, $verbose = false, $limitTo = null)
$comments = (array)json_decode($this->apiGet($comment_uri, $params));
- $commentData = array();
+ $commentData = [];
foreach ($comments['comments'] as $item) {
if (isset($item->user_uri)) {
@@ -170,12 +170,12 @@ public function getComments($comment_uri, $verbose = false, $limitTo = null)
*/
public function addComment($talk, $rating, $comment)
{
- $uri = $talk->getCommentsUri();
- $params = array(
- 'rating' => $rating,
+ $uri = $talk->getCommentsUri();
+ $params = [
+ 'rating' => $rating,
'comment' => $comment,
- );
- list ($status, $result) = $this->apiPost($uri, $params);
+ ];
+ list($status, $result) = $this->apiPost($uri, $params);
if ($status == 201) {
return true;
@@ -185,7 +185,7 @@ public function addComment($talk, $rating, $comment)
public function reportComment($uri)
{
- list ($status, $result) = $this->apiPost($uri);
+ list($status, $result) = $this->apiPost($uri);
if ($status == 202) {
return true;
@@ -201,12 +201,12 @@ public function reportComment($uri)
public function toggleStar($talk)
{
if ($talk->getStarred()) {
- list ($status, $result) = $this->apiDelete($talk->getStarredUri(), []);
+ list($status, $result) = $this->apiDelete($talk->getStarredUri(), []);
if ($status == 200) {
return ['starred' => false];
}
} else {
- list ($status, $result) = $this->apiPost($talk->getStarredUri(), []);
+ list($status, $result) = $this->apiPost($talk->getStarredUri(), []);
if ($status == 201) {
return ['starred' => true];
}
@@ -232,9 +232,9 @@ public function getAgenda($talksUri)
$agenda = [];
foreach ($talks as $talk) {
- $date = $talk->getStartDateTime()->format("Y-m-d");
- $startTime = $talk->getStartDateTime()->format("H:i");
- $time = "$startTime";
+ $date = $talk->getStartDateTime()->format("Y-m-d");
+ $startTime = $talk->getStartDateTime()->format("H:i");
+ $time = "$startTime";
$agenda[$date][$time][] = $talk;
}
@@ -267,7 +267,7 @@ public function addTalk($talksUri, $data)
}
- list ($status, $result, $headers) = $this->apiPost($talksUri, $data);
+ list($status, $result, $headers) = $this->apiPost($talksUri, $data);
// if successful, return talk entity represented by the URL in the Location header
if ($status == 201) {
$response = $this->getCollection($headers['location']);
@@ -311,10 +311,10 @@ public function editTalk($talkUri, $data)
$data['speakers'] = array_filter($data['speakers']);
}
$talkId = basename($talkUri);
- $media = $this->getTalkLinksById($talkId);
+ $media = $this->getTalkLinksById($talkId);
$this->handleTalkLinksUpdate($talkId, $media, $data['talk_media']);
- list ($status, $result, $headers) = $this->apiPut($talkUri, $data);
+ list($status, $result, $headers) = $this->apiPut($talkUri, $data);
// if successful, return talk entity represented by the URL in the Location header
if ($status == 204) {
@@ -332,13 +332,13 @@ public function editTalk($talkUri, $data)
public function claimTalk($talkSpeakersUri, $data)
{
- list ($status, $result, $headers) = $this->apiPost($talkSpeakersUri, $data);
+ list($status, $result, $headers) = $this->apiPost($talkSpeakersUri, $data);
if ($status == 204) {
return true;
}
- $result = json_decode($result);
+ $result = json_decode($result);
$message = $result[0];
throw new Exception("Failed: " . $message);
@@ -346,13 +346,13 @@ public function claimTalk($talkSpeakersUri, $data)
public function rejectTalkClaim($talkSpeakersUri, $data)
{
- list ($status, $result, $headers) = $this->apiDelete($talkSpeakersUri, $data);
+ list($status, $result, $headers) = $this->apiDelete($talkSpeakersUri, $data);
if ($status == 204) {
return true;
}
- $result = json_decode($result);
+ $result = json_decode($result);
$message = $result[0];
throw new Exception("Failed: " . $message);
@@ -377,7 +377,7 @@ public function addTalkToTrack($talkTracksUri, $trackUri)
return true;
}
- $result = json_decode($result);
+ $result = json_decode($result);
$message = $result[0];
throw new Exception("Failed: " . $message);
@@ -397,7 +397,7 @@ public function removeTalkFromTrack($removeTrackUri)
return true;
}
- $result = json_decode($result);
+ $result = json_decode($result);
$message = $result[0];
throw new Exception("Failed to remove talk from track: " . $message);
@@ -411,7 +411,7 @@ public function unlinkVerifiedSpeakerFromTalk($unlinkSpeakerUri)
return true;
}
- $result = json_decode($result);
+ $result = json_decode($result);
$message = $result[0];
throw new \Exception("Failed to unlink speaker from talk: " . $message);
@@ -429,7 +429,7 @@ public function unlinkVerifiedSpeakerFromTalk($unlinkSpeakerUri)
*/
public function deleteTalk($clientUri)
{
- list ($status, $result, $headers) = $this->apiDelete($clientUri);
+ list($status, $result, $headers) = $this->apiDelete($clientUri);
if ($status != 204) {
$decoded = json_decode($result);
@@ -492,9 +492,9 @@ protected function addTalkMedia($talkId, $media)
}
$talkUrl = $this->baseApiUrl . '/v2.1/talks/' . $talkId . '/links';
- $params = [
+ $params = [
'display_name' => $media['type'],
- 'url' => $media['url'],
+ 'url' => $media['url'],
];
list($status, $result, $headers) = $this->apiPost($talkUrl, $params);
@@ -508,9 +508,9 @@ protected function addTalkMedia($talkId, $media)
protected function updateTalkMedia($talkId, $mediaId, $media)
{
$talkUrl = $this->baseApiUrl . '/v2.1/talks/' . $talkId . '/links/' . $mediaId;
- $params = [
+ $params = [
'display_name' => $media['type'],
- 'url' => $media['url'],
+ 'url' => $media['url'],
];
list($status, $result, $headers) = $this->apiPut($talkUrl, $params);
if ($status == 204) {
@@ -523,6 +523,7 @@ protected function updateTalkMedia($talkId, $mediaId, $media)
protected function deleteTalkMedia($talkId, $mediaId)
{
$talkUrl = $this->baseApiUrl . '/v2.1/talks/' . $talkId . '/links/' . $mediaId;
+
list($status, $result, $headers) = $this->apiDelete($talkUrl);
if ($status == 204) {
diff --git a/app/src/Talk/TalkCommentEntity.php b/app/src/Talk/TalkCommentEntity.php
index f863173fd..05df62a6e 100644
--- a/app/src/Talk/TalkCommentEntity.php
+++ b/app/src/Talk/TalkCommentEntity.php
@@ -1,8 +1,7 @@
data->user_uri) && $this->data->user_uri == $user_uri) {
return false;
}
diff --git a/app/src/Talk/TalkCommentReportEntity.php b/app/src/Talk/TalkCommentReportEntity.php
index 58e5c67fe..8f825bc62 100644
--- a/app/src/Talk/TalkCommentReportEntity.php
+++ b/app/src/Talk/TalkCommentReportEntity.php
@@ -1,7 +1,7 @@
get('/event/:eventSlug/:talkSlug', array($this, 'index'))->name('talk');
- $app->map('/event/:eventSlug/:talkSlug/edit', array($this, 'editTalk'))->via('GET', 'POST')->name('talk-edit');
- $app->post('/event/:eventSlug/:talkSlug/star', array($this, 'star'))->name('talk-star');
- $app->get('/talk/:talkStub', array($this, 'quick'))->name('talk-quicklink');
- $app->get('/event/:eventSlug/:talkSlug/comments/:commentHash/report', array($this, 'reportComment'))
+ $app->get('/event/:eventSlug/:talkSlug', [$this, 'index'])
+ ->name('talk');
+ $app->map('/event/:eventSlug/:talkSlug/edit', [$this, 'editTalk'])
+ ->via('GET', 'POST')
+ ->name('talk-edit');
+ $app->post('/event/:eventSlug/:talkSlug/star', [$this, 'star'])
+ ->name('talk-star');
+ $app->get('/talk/:talkStub', [$this, 'quick'])
+ ->name('talk-quicklink');
+ $app->get('/event/:eventSlug/:talkSlug/comments/:commentHash/report', [$this, 'reportComment'])
->name('talk-report-comment');
- $app->post('/event/:eventSlug/:talkSlug/add-comment', array($this, 'addComment'))->name('talk-add-comment');
- $app->get('/:talkId', array($this, 'quickById'))
+ $app->post('/event/:eventSlug/:talkSlug/add-comment', [$this, 'addComment'])
+ ->name('talk-add-comment');
+ $app->get('/:talkId', [$this, 'quickById'])
->name('talk-quick-by-id')
- ->conditions(array('talkId' => '\d+'));
- $app->get('/talk/view/:talkId', array($this, 'quickById'))
+ ->conditions(['talkId' => '\d+']);
+ $app->get('/talk/view/:talkId', [$this, 'quickById'])
->name('talk-by-id-web1')
- ->conditions(array('talkId' => '\d+'));
- $app->post('/event/:eventSlug/:talkSlug/claim', array($this, 'claimTalk'))->name('talk-claim');
- $app->get('/event/:eventSlug/:talkSlug/unlink/:username', array($this, 'unlinkSpeaker'))
+ ->conditions(['talkId' => '\d+']);
+ $app->post('/event/:eventSlug/:talkSlug/claim', [$this, 'claimTalk'])
+ ->name('talk-claim');
+ $app->get('/event/:eventSlug/:talkSlug/unlink/:username', [$this, 'unlinkSpeaker'])
->name('unlink-speaker');
- $app->map('/event/:eventSlug/:talkSlug/delete', array($this, 'deleteTalk'))->via('GET', 'POST')->name('talk-delete');
+ $app->map('/event/:eventSlug/:talkSlug/delete', [$this, 'deleteTalk'])
+ ->via('GET', 'POST')
+ ->name('talk-delete');
}
public function index($eventSlug, $talkSlug)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($eventSlug);
+ $event = $eventApi->getByFriendlyUrl($eventSlug);
if (!$event) {
return Slim::getInstance()->notFound();
}
$talkApi = $this->getTalkApi();
- $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
+ $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
if (!$talk) {
return Slim::getInstance()->notFound();
}
@@ -79,15 +86,15 @@ public function index($eventSlug, $talkSlug)
$this->render(
'Talk/index.html.twig',
- array(
- 'talk' => $talk,
- 'event' => $event,
- 'comments' => $comments,
- 'talkSlug' => $talkSlug,
+ [
+ 'talk' => $talk,
+ 'event' => $event,
+ 'comments' => $comments,
+ 'talkSlug' => $talkSlug,
'canEditTalk' => $canEditTalk,
'canRateTalk' => $canRateTalk,
'unclaimed' => $unclaimed,
- )
+ ]
);
}
@@ -101,7 +108,7 @@ public function editTalk($eventSlug, $talkSlug)
}
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($eventSlug);
+ $event = $eventApi->getByFriendlyUrl($eventSlug);
if (!$event) {
$this->application->notFound();
@@ -109,15 +116,15 @@ public function editTalk($eventSlug, $talkSlug)
}
$talkApi = $this->getTalkApi();
- $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
+ $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
if (!$talk) {
$this->application->notFound();
return;
}
- $talkId = basename($talk['uri']);
+ $talkId = basename($talk['uri']);
$talkMedia = $talkApi->getTalkLinksById($talkId);
- $isAdmin = $event->getCanEdit();
+ $isAdmin = $event->getCanEdit();
$isSpeaker = $talk->isSpeaker($_SESSION['user']->getUri());
if (!($isAdmin || $isSpeaker)) {
$this->application->flash('error', "You do not have permission to do this.");
@@ -127,22 +134,22 @@ public function editTalk($eventSlug, $talkSlug)
}
$languageApi = $this->getLanguageApi();
- $languages = $languageApi->getLanguagesChoiceList();
+ $languages = $languageApi->getLanguagesChoiceList();
$talkTypeApi = $this->getTalkTypeApi();
- $talkTypes = $talkTypeApi->getTalkTypesChoiceList();
+ $talkTypes = $talkTypeApi->getTalkTypesChoiceList();
$trackApi = $this->getTrackApi();
- $tracks = $trackApi->getTracksChoiceList($event->getTracksUri());
+ $tracks = $trackApi->getTracksChoiceList($event->getTracksUri());
// default values
- $data = [];
- $data['talk_title'] = $talk->getTitle();
+ $data = [];
+ $data['talk_title'] = $talk->getTitle();
$data['talk_description'] = $talk->getDescription();
- $data['start_date'] = $talk->getStartDateTime();
- $data['duration'] = $talk->getDuration();
- $data['language'] = $talk->getLanguage();
- $data['type'] = $talk->getType();
+ $data['start_date'] = $talk->getStartDateTime();
+ $data['duration'] = $talk->getDuration();
+ $data['language'] = $talk->getLanguage();
+ $data['type'] = $talk->getType();
if ($talk->getTracks()) {
$data['track'] = $talk->getTracks()[0]->track_uri;
}
@@ -155,13 +162,13 @@ public function editTalk($eventSlug, $talkSlug)
foreach ($talkMedia as $media) {
$data['talk_media'][$media->id] = [
'type' => $media->display_name,
- 'url' => $media->url
+ 'url' => $media->url
];
}
/** @var FormFactoryInterface $factory */
$factory = $this->application->formFactory;
- $form = $factory->create(new TalkFormType($event, $languages, $talkTypes, $tracks), $data);
+ $form = $factory->create(new TalkFormType($event, $languages, $talkTypes, $tracks), $data);
$request = $this->application->request();
if ($request->isPost()) {
@@ -177,7 +184,7 @@ public function editTalk($eventSlug, $talkSlug)
try {
$talkApi = $this->getTalkApi();
- $talk = $talkApi->editTalk($talk->getApiUri(), $values);
+ $talk = $talkApi->editTalk($talk->getApiUri(), $values);
if (!empty($values['track']) && isset($tracks[$values['track']])) {
$talkTracks = [];
@@ -213,10 +220,10 @@ public function editTalk($eventSlug, $talkSlug)
$this->render(
'Talk/edit-talk.html.twig',
[
- 'talk' => $talk,
- 'event' => $event,
+ 'talk' => $talk,
+ 'event' => $event,
'talkSlug' => $talkSlug,
- 'form' => $form->createView(),
+ 'form' => $form->createView(),
]
);
}
@@ -231,10 +238,10 @@ public function claimTalk($eventSlug, $talkSlug)
);
}
- $request = $this->application->request();
+ $request = $this->application->request();
$display_name = $request->post('display_name');
- $eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($eventSlug);
+ $eventApi = $this->getEventApi();
+ $event = $eventApi->getByFriendlyUrl($eventSlug);
if (!$event) {
$this->application->notFound();
@@ -242,14 +249,14 @@ public function claimTalk($eventSlug, $talkSlug)
}
$talkApi = $this->getTalkApi();
- $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
+ $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
if (!$talk) {
$this->application->notFound();
return;
}
$speakers = $talk->getSpeakers();
- $valid = false;
+ $valid = false;
foreach ($speakers as $speaker) {
if (! isset($speaker->speaker_uri) && $speaker->speaker_name == $display_name) {
$valid = true;
@@ -260,10 +267,10 @@ public function claimTalk($eventSlug, $talkSlug)
try {
$talkApi->claimTalk(
$talk->getSpeakersUri(),
- array(
+ [
'display_name' => $display_name,
'username' => $_SESSION['user']->getUsername()
- )
+ ]
);
$this->application->flash(
@@ -278,14 +285,14 @@ public function claimTalk($eventSlug, $talkSlug)
$this->application->flash('claimerror', "No speaker {$display_name} found for this talk.");
}
- $url = $this->application->urlFor("talk", array('eventSlug' => $eventSlug, 'talkSlug' => $talkSlug));
+ $url = $this->application->urlFor("talk", ['eventSlug' => $eventSlug, 'talkSlug' => $talkSlug]);
$this->application->redirect($url);
}
public function star($eventSlug, $talkSlug)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($eventSlug);
+ $event = $eventApi->getByFriendlyUrl($eventSlug);
$this->application->contentType('application/json');
if (!$event) {
@@ -294,7 +301,7 @@ public function star($eventSlug, $talkSlug)
}
$talkApi = $this->getTalkApi();
- $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
+ $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
if (!$talk) {
$this->application->notFound();
return;
@@ -314,10 +321,10 @@ public function star($eventSlug, $talkSlug)
public function quick($talkStub)
{
$talkDb = $this->application->container->get(TalkDb::class);
- $talk = $talkDb->load('stub', $talkStub);
+ $talk = $talkDb->load('stub', $talkStub);
$eventDb = $this->application->container->get(EventDb::class);
- $event = $eventDb->load('uri', $talk['event_uri']);
+ $event = $eventDb->load('uri', $talk['event_uri']);
if (!$event) {
return \Slim\Slim::getInstance()->notFound();
}
@@ -325,7 +332,7 @@ public function quick($talkStub)
$this->application->redirect(
$this->application->urlFor(
'talk',
- array('eventSlug' => $event['url_friendly_name'], 'talkSlug' => $talk['slug'])
+ ['eventSlug' => $event['url_friendly_name'], 'talkSlug' => $talk['slug']]
)
);
}
@@ -335,7 +342,7 @@ public function quickById($talkId)
$eventDb = $this->application->container->get(EventDb::class);
$talkApi = $this->getTalkApi();
- $talk = $talkApi->getTalkByTalkId($talkId);
+ $talk = $talkApi->getTalkByTalkId($talkId);
if (!$talk) {
return \Slim\Slim::getInstance()->notFound();
}
@@ -343,7 +350,7 @@ public function quickById($talkId)
$event = $eventDb->load('uri', $talk->getEventUri());
if (!$event) {
// load from API as not in cache
- $eventApi = $this->getEventApi();
+ $eventApi = $this->getEventApi();
$eventEntity = $eventApi->getEvent($talk->getEventUri());
if (!$eventEntity) {
return \Slim\Slim::getInstance()->notFound();
@@ -354,7 +361,7 @@ public function quickById($talkId)
$this->application->redirect(
$this->application->urlFor(
'talk',
- array('eventSlug' => $event['url_friendly_name'], 'talkSlug' => $talk->getUrlFriendlyTalkTitle())
+ ['eventSlug' => $event['url_friendly_name'], 'talkSlug' => $talk->getUrlFriendlyTalkTitle()]
)
);
}
@@ -363,8 +370,8 @@ public function addComment($eventSlug, $talkSlug)
{
$request = $this->application->request();
$comment = trim(strip_tags($request->post('comment')));
- $rating = (int) $request->post('rating');
- $url = $this->application->urlFor("talk", array('eventSlug' => $eventSlug, 'talkSlug' => $talkSlug));
+ $rating = (int)$request->post('rating');
+ $url = $this->application->urlFor("talk", ['eventSlug' => $eventSlug, 'talkSlug' => $talkSlug]);
if ($comment == '' || $rating == 0) {
$this->application->flash('error', 'Please provide a comment and rating');
@@ -381,10 +388,10 @@ public function addComment($eventSlug, $talkSlug)
}
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($eventSlug);
+ $event = $eventApi->getByFriendlyUrl($eventSlug);
$talkApi = $this->getTalkApi();
- $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
+ $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
if ($talk) {
try {
$talkApi->addComment($talk, $rating, $comment);
@@ -425,10 +432,10 @@ public function addComment($eventSlug, $talkSlug)
public function reportComment($eventSlug, $talkSlug, $commentHash)
{
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($eventSlug);
- $talkApi = $this->getTalkApi();
- $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
- $url = $this->application->urlFor("talk", array('eventSlug' => $eventSlug, 'talkSlug' => $talkSlug));
+ $event = $eventApi->getByFriendlyUrl($eventSlug);
+ $talkApi = $this->getTalkApi();
+ $talk = $talkApi->getTalkBySlug($talkSlug, $event->getUri());
+ $url = $this->application->urlFor("talk", ['eventSlug' => $eventSlug, 'talkSlug' => $talkSlug]);
$comments = $talkApi->getComments($talk->getCommentsUri());
foreach ($comments as $comment) {
@@ -466,16 +473,16 @@ public function unlinkSpeaker($eventSlug, $talkSlug, $username)
}
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($eventSlug);
+ $event = $eventApi->getByFriendlyUrl($eventSlug);
$eventUri = $event->getUri();
$talkApi = $this->getTalkApi();
- $talk = $talkApi->getTalkBySlug($talkSlug, $eventUri);
+ $talk = $talkApi->getTalkBySlug($talkSlug, $eventUri);
$talkUri = $talk->getApiUri();
$userApi = $this->getUserApi();
- $user = $userApi->getUserByUsername($username);
- $userId = $user->getId();
+ $user = $userApi->getUserByUsername($username);
+ $userId = $user->getId();
$unlinkSpeakerUri = $talkUri . "/speakers/" . $userId;
@@ -511,7 +518,7 @@ public function deleteTalk($eventSlug, $talkSlug)
}
$eventApi = $this->getEventApi();
- $event = $eventApi->getByFriendlyUrl($eventSlug);
+ $event = $eventApi->getByFriendlyUrl($eventSlug);
if (! $event->getCanEdit()) {
$this->application->redirect(
@@ -533,7 +540,7 @@ public function deleteTalk($eventSlug, $talkSlug)
}
// default values
- $data = [];
+ $data = [];
$data['talk_uri'] = $talk->getApiUri();
$factory = $this->application->formFactory;
@@ -572,7 +579,7 @@ public function deleteTalk($eventSlug, $talkSlug)
$this->render(
'Talk/delete-talk.html.twig',
[
- 'talk' => $talk,
+ 'talk' => $talk,
'form' => $form->createView(),
'backUri' => $this->application->urlFor('talk', [
'eventSlug' => $eventSlug,
diff --git a/app/src/Talk/TalkDb.php b/app/src/Talk/TalkDb.php
index 15183c6cf..a0c21ad25 100644
--- a/app/src/Talk/TalkDb.php
+++ b/app/src/Talk/TalkDb.php
@@ -1,8 +1,8 @@
cache->loadByKeys($this->keyName, array(
+ $data = $this->cache->loadByKeys($this->keyName, [
'event_uri' => $eventUri,
- 'slug' => $slug
- ));
+ 'slug' => $slug
+ ]);
if ($data) {
return $data['uri'];
@@ -38,14 +38,14 @@ public function getSlugFor($talkUri)
public function save(TalkEntity $talk)
{
- $data = array(
- 'uri' => $talk->getApiUri(),
- 'title' => $talk->getTitle(),
- 'slug' => $talk->getUrlFriendlyTalkTitle(),
+ $data = [
+ 'uri' => $talk->getApiUri(),
+ 'title' => $talk->getTitle(),
+ 'slug' => $talk->getUrlFriendlyTalkTitle(),
'verbose_uri' => $talk->getApiUri(true),
- 'event_uri' => $talk->getEventUri(),
- 'stub' => $talk->getStub(),
- );
+ 'event_uri' => $talk->getEventUri(),
+ 'stub' => $talk->getStub(),
+ ];
$savedTalk = $this->load('uri', $talk->getApiUri());
if ($savedTalk) {
@@ -53,10 +53,10 @@ public function save(TalkEntity $talk)
$data = array_merge($savedTalk, $data);
}
- $keys = array(
+ $keys = [
'event_uri' => $talk->getEventUri(),
- 'slug' => $talk->getUrlFriendlyTalkTitle()
- );
+ 'slug' => $talk->getUrlFriendlyTalkTitle()
+ ];
$this->cache->saveByKeys($this->keyName, $data, $keys);
$this->cache->save($this->keyName, $data, 'uri', $talk->getApiUri());
$this->cache->save($this->keyName, $data, 'stub', $talk->getStub());
diff --git a/app/src/Talk/TalkDeleteFormType.php b/app/src/Talk/TalkDeleteFormType.php
index db7416607..6f6cf9044 100644
--- a/app/src/Talk/TalkDeleteFormType.php
+++ b/app/src/Talk/TalkDeleteFormType.php
@@ -1,11 +1,10 @@
add(
'talk_uri',
- 'hidden',
+ HiddenType::class,
[]
)
;
diff --git a/app/src/Talk/TalkEntity.php b/app/src/Talk/TalkEntity.php
index 9305e29a7..3f4e37fb9 100644
--- a/app/src/Talk/TalkEntity.php
+++ b/app/src/Talk/TalkEntity.php
@@ -1,10 +1,10 @@
getStartDateTime();
- $end_time = $start_time->add(new DateInterval('PT'.$this->data->duration.'M'));
+ $end_time = $start_time->add(new DateInterval('PT' . $this->data->duration . 'M'));
return $end_time;
}
diff --git a/app/src/Talk/TalkFormType.php b/app/src/Talk/TalkFormType.php
index 08e6660d1..62e361fc7 100644
--- a/app/src/Talk/TalkFormType.php
+++ b/app/src/Talk/TalkFormType.php
@@ -1,11 +1,18 @@
timezone = $event->getFullTimezone();
- $tz = new \DateTimeZone($this->timezone);
- $this->startDate = new \DateTimeImmutable($event->getStartDate(), $tz);
- $this->endDate = new \DateTimeImmutable($event->getEndDate(), $tz);
+ $this->timezone = $event->getFullTimezone();
+ $tz = new \DateTimeZone($this->timezone);
+ $this->startDate = new DateTimeImmutable($event->getStartDate(), $tz);
+ $this->endDate = new DateTimeImmutable($event->getEndDate(), $tz);
$this->languages = $languages;
$this->talkTypes = $talkTypes;
- $this->tracks = $tracks;
+ $this->tracks = $tracks;
}
-
/**
* Returns the name of this form type.
*
@@ -78,60 +84,60 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$builder
->add(
'talk_title',
- 'text',
+ TextType::class,
[
'constraints' => [new Assert\NotBlank()],
]
)
->add(
'talk_description',
- 'textarea',
+ TextareaType::class,
[
'constraints' => [new Assert\NotBlank()],
- 'attr'=> ['rows' => '10']
+ 'attr' => ['rows' => '10']
]
)
->add(
'start_date',
- 'datetime',
+ DateTimeType::class,
[
- 'label' => 'Date and time of talk',
- 'date_widget' => 'single_text',
- 'time_widget' => 'single_text',
- 'date_format' => 'd MMMM y',
+ 'label' => 'Date and time of talk',
+ 'date_widget' => 'single_text',
+ 'time_widget' => 'single_text',
+ 'date_format' => 'd MMMM y',
'model_timezone' => $this->timezone,
- 'view_timezone' => $this->timezone,
- 'constraints' => [
+ 'view_timezone' => $this->timezone,
+ 'constraints' => [
new Assert\NotBlank(),
new Assert\Date()
],
'attr' => [
'date_widget' => [
- 'class' => 'date-picker form-control',
- 'data-provide' => 'datepicker',
- 'data-date-format' => 'd MM yyyy',
- 'data-date-week-start' => '1',
- 'data-date-autoclose' => '1',
+ 'class' => 'date-picker form-control',
+ 'data-provide' => 'datepicker',
+ 'data-date-format' => 'd MM yyyy',
+ 'data-date-week-start' => '1',
+ 'data-date-autoclose' => '1',
'data-date-today-highlight' => true,
- 'data-date-start-date '=> $this->startDate->format('j F Y'),
- 'data-date-end-date' => $this->endDate->format('j F Y'),
+ 'data-date-start-date ' => $this->startDate->format('j F Y'),
+ 'data-date-end-date' => $this->endDate->format('j F Y'),
],
'time_widget' => [
- 'class' => 'time-picker form-control',
- 'data-provide' => 'timepicker',
+ 'class' => 'time-picker form-control',
+ 'data-provide' => 'timepicker',
'data-show-meridian' => 'false',
- 'data-default-time' => '09:00',
- 'placeholder' => 'HH:MM',
+ 'data-default-time' => '09:00',
+ 'placeholder' => 'HH:MM',
],
]
]
)
->add(
'duration',
- 'integer',
+ IntegerType::class,
[
- 'label' => 'Duration (mins)',
- 'precision' => 0,
+ 'label' => 'Duration (mins)',
+ 'precision' => 0,
'constraints' => [
new Assert\NotBlank(),
new Assert\Type('integer'),
@@ -144,43 +150,43 @@ public function buildForm(FormBuilderInterface $builder, array $options)
)
->add(
'language',
- 'choice',
+ ChoiceType::class,
[
'choices' => ['' => ''] + $this->languages
]
)
->add(
'type',
- 'choice',
+ ChoiceType::class,
[
'choices' => ['' => ''] + $this->talkTypes
]
)
->add(
'track',
- 'choice',
+ ChoiceType::class,
[
- 'required' => (bool) !empty($this->tracks),
- 'choices' => ['' => ''] + $this->tracks
+ 'required' => (bool) ! empty($this->tracks),
+ 'choices' => ['' => ''] + $this->tracks
]
)
->add(
'speakers',
- 'collection',
+ CollectionType::class,
[
- 'label' => 'Speakers!',
- 'type' => new SpeakerFormType(),
- 'allow_add' => true,
+ 'label' => 'Speakers!',
+ 'type' => new SpeakerFormType(),
+ 'allow_add' => true,
'allow_delete' => true,
]
)
->add(
'talk_media',
- 'collection',
+ CollectionType::class,
[
- 'label' => 'Talk Media',
- 'type' => new TalkMediaFormType(),
- 'allow_add' => true,
+ 'label' => 'Talk Media',
+ 'type' => new TalkMediaFormType(),
+ 'allow_add' => true,
'allow_delete' => true,
]
)
diff --git a/app/src/Talk/TalkMediaFormType.php b/app/src/Talk/TalkMediaFormType.php
index b1158aadf..8cb111f86 100644
--- a/app/src/Talk/TalkMediaFormType.php
+++ b/app/src/Talk/TalkMediaFormType.php
@@ -1,9 +1,10 @@
add(
'type',
- 'choice',
+ ChoiceType::class,
[
'choices' => [
'slides_link' => 'Slides',
@@ -46,7 +47,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'label' => false,
]
)
- ->add('url', 'text', [
+ ->add('url', TextType::class, [
'label' => false,
'required' => false,
])
diff --git a/app/src/Talk/TalkTypeApi.php b/app/src/Talk/TalkTypeApi.php
index 1b620823e..b8647fc3c 100644
--- a/app/src/Talk/TalkTypeApi.php
+++ b/app/src/Talk/TalkTypeApi.php
@@ -1,7 +1,7 @@
baseApiUrl . '/v2.1/talk_types';
+ $url = $this->baseApiUrl . '/v2.1/talk_types';
$queryParams['resultsperpage'] = 0;
$result = $this->apiGet($url, $queryParams);
diff --git a/app/src/User/AuthApi.php b/app/src/User/AuthApi.php
index 1bc546837..444710bc3 100644
--- a/app/src/User/AuthApi.php
+++ b/app/src/User/AuthApi.php
@@ -1,7 +1,7 @@
baseApiUrl . '/v2.1/token';
- $params = array(
+ $url = $this->baseApiUrl . '/v2.1/token';
+ $params = [
'grant_type' => 'password',
'client_id' => $clientId,
'client_secret' => $clientSecret,
'username' => $username,
'password' => $password,
- );
+ ];
list($status, $result) = $this->apiPost($url, $params);
if ($result) {
@@ -44,13 +44,13 @@ public function login($username, $password, $clientId, $clientSecret)
*/
public function getTwitterRequestToken($clientId, $clientSecret)
{
- $url = $this->baseApiUrl . '/v2.1/twitter/request_token';
- $params = array(
+ $url = $this->baseApiUrl . '/v2.1/twitter/request_token';
+ $params = [
'client_id' => $clientId,
'client_secret' => $clientSecret,
- );
+ ];
- list ($status, $result, $headers) = $this->apiPost($url, $params);
+ list($status, $result, $headers) = $this->apiPost($url, $params);
if ($status == 201) {
// we got one, data is actually in the body
$data = json_decode($result);
@@ -70,15 +70,15 @@ public function getTwitterRequestToken($clientId, $clientSecret)
*/
public function verifyTwitter($clientId, $clientSecret, $token, $verifier)
{
- $url = $this->baseApiUrl . '/v2.1/twitter/token';
- $params = array(
+ $url = $this->baseApiUrl . '/v2.1/twitter/token';
+ $params = [
'client_id' => $clientId,
'client_secret' => $clientSecret,
'token' => $token,
'verifier' => $verifier,
- );
+ ];
- list ($status, $result, $headers) = $this->apiPost($url, $params);
+ list($status, $result, $headers) = $this->apiPost($url, $params);
if ($result) {
$data = json_decode($result);
if ($data) {
@@ -99,14 +99,14 @@ public function verifyTwitter($clientId, $clientSecret, $token, $verifier)
*/
public function verifyFacebook($clientId, $clientSecret, $code)
{
- $url = $this->baseApiUrl . '/v2.1/facebook/token';
- $params = array(
+ $url = $this->baseApiUrl . '/v2.1/facebook/token';
+ $params = [
'client_id' => $clientId,
'client_secret' => $clientSecret,
'code' => $code,
- );
+ ];
- list ($status, $result, $headers) = $this->apiPost($url, $params);
+ list($status, $result, $headers) = $this->apiPost($url, $params);
if ($result) {
$data = json_decode($result);
if ($data) {
diff --git a/app/src/User/EmailInputFormType.php b/app/src/User/EmailInputFormType.php
index 28e764061..20c417130 100644
--- a/app/src/User/EmailInputFormType.php
+++ b/app/src/User/EmailInputFormType.php
@@ -1,8 +1,9 @@
add(
'email',
- 'text',
+ TextType::class,
[
- 'required' => true,
+ 'required' => true,
'constraints' => [new Assert\NotBlank(), new Assert\Email()],
]
)
diff --git a/app/src/User/NewPasswordFormType.php b/app/src/User/NewPasswordFormType.php
index 9916a25b1..f18bcb4f8 100644
--- a/app/src/User/NewPasswordFormType.php
+++ b/app/src/User/NewPasswordFormType.php
@@ -1,8 +1,9 @@
add(
'password',
- 'repeated',
+ RepeatedType::class,
[
- 'type' => 'password',
+ 'type' => 'password',
'invalid_message' => 'The password fields must match.',
- 'required' => true,
- 'first_options' => array('label' => 'Password'),
- 'second_options' => array('label' => 'Repeat Password'),
- 'constraints' => [new Assert\NotBlank(), new Assert\Length(['min' => 6])],
+ 'required' => true,
+ 'first_options' => ['label' => 'Password'],
+ 'second_options' => ['label' => 'Repeat Password'],
+ 'constraints' => [new Assert\NotBlank(), new Assert\Length(['min' => 6])],
]
)
;
diff --git a/app/src/User/RegisterFormType.php b/app/src/User/RegisterFormType.php
index 403aee62c..4f5566ff7 100644
--- a/app/src/User/RegisterFormType.php
+++ b/app/src/User/RegisterFormType.php
@@ -1,8 +1,11 @@
add(
'username',
- 'text',
+ TextType::class,
[
'constraints' => [new Assert\NotBlank(), new Assert\Length(['max' => 100])],
]
)
->add(
'password',
- 'repeated',
+ RepeatedType::class,
[
- 'type' => 'password',
+ 'type' => 'password',
'invalid_message' => 'The password fields must match.',
- 'required' => true,
- 'first_options' => array('label' => 'Password'),
- 'second_options' => array('label' => 'Repeat Password'),
- 'constraints' => [new Assert\NotBlank(), new Assert\Length(['min' => 6])],
+ 'required' => true,
+ 'first_options' => ['label' => 'Password'],
+ 'second_options' => ['label' => 'Repeat Password'],
+ 'constraints' => [new Assert\NotBlank(), new Assert\Length(['min' => 6])],
]
)
->add(
'email',
- 'text',
+ TextType::class,
[
- 'required' => true,
+ 'required' => true,
'constraints' => [new Assert\NotBlank(), new Assert\Email()],
]
)
->add(
'full_name',
- 'text',
+ TextType::class,
[
- 'required' => true,
+ 'required' => true,
'constraints' => [new Assert\NotBlank(), new Assert\Length(['max' => 200])],
]
)
->add(
'twitter_username',
- 'text',
+ TextType::class,
[
'required' => false
]
)
->add(
'biography',
- 'textarea',
+ TextareaType::class,
[
- 'required' => false,
+ 'required' => false,
'empty_data' => '',
- 'attr' => [
- 'rows' => 4,
+ 'attr' => [
+ 'rows' => 4,
'maxlength' => '400'
]
]
diff --git a/app/src/User/UserApi.php b/app/src/User/UserApi.php
index cd5ec3457..efa6bc81b 100644
--- a/app/src/User/UserApi.php
+++ b/app/src/User/UserApi.php
@@ -1,7 +1,7 @@
apiGet($url, array('verbose'=>'yes'));
+ $result = $this->apiGet($url, ['verbose' =>'yes']);
if ($result) {
$data = json_decode($result, false, 512, JSON_BIGINT_AS_STRING);
@@ -69,8 +69,7 @@ public function getUserByUserId($userId)
*/
public function register($data)
{
-
- list ($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/users', $data);
+ list($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/users', $data);
if ($status == 201) {
// user URI in $headers['location'] but the user is pending so it's not useful
@@ -98,9 +97,9 @@ public function register($data)
*/
public function verify($token)
{
- $data = array("token" => $token);
+ $data = ["token" => $token];
- list ($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/users/verifications', $data);
+ list($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/users/verifications', $data);
if ($status == 204) {
return true;
@@ -120,9 +119,9 @@ public function verify($token)
*/
public function reverify($email)
{
- $data = array("email" => $email);
+ $data = ["email" => $email];
- list ($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/emails/verifications', $data);
+ list($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/emails/verifications', $data);
if ($status == 202) {
return true;
@@ -146,8 +145,8 @@ public function reverify($email)
public function getUserByUsername($username)
{
// fetch via filtering the users collection
- $url = $this->baseApiUrl . '/v2.1/users';
- $result = $this->apiGet($url, ['username' => $username, 'verbose'=>'yes']);
+ $url = $this->baseApiUrl . '/v2.1/users';
+ $result = $this->apiGet($url, ['username' => $username, 'verbose' => 'yes']);
if ($result) {
$data = json_decode($result);
@@ -200,9 +199,9 @@ public function getUsername($uri)
*/
public function usernameReminder($email)
{
- $data = array("email" => $email);
+ $data = ["email" => $email];
- list ($status, $result, $headers) = $this->apiPost(
+ list($status, $result, $headers) = $this->apiPost(
$this->baseApiUrl . '/v2.1/emails/reminders/username',
$data
);
@@ -231,9 +230,9 @@ public function usernameReminder($email)
*/
public function passwordReset($username)
{
- $data = array("username" => $username);
+ $data = ["username" => $username];
- list ($status, $result, $headers) = $this->apiPost(
+ list($status, $result, $headers) = $this->apiPost(
$this->baseApiUrl . '/v2.1/emails/reminders/password',
$data
);
@@ -264,7 +263,7 @@ public function passwordReset($username)
*/
public function edit($uri, array $data)
{
- list ($status, $result, $headers) = $this->apiPut($uri, $data);
+ list($status, $result, $headers) = $this->apiPut($uri, $data);
// if successful, return event entity represented by the URL in the Location header
if ($status == 204) {
@@ -275,10 +274,9 @@ public function edit($uri, array $data)
throw new \Exception('Your profile update was not accepted. The server reports: ' . $result);
}
-
public function delete($uri)
{
- list ($status, $result) = $this->apiDelete($uri, []);
+ list($status, $result) = $this->apiDelete($uri, []);
if ($status == 204) {
return true;
@@ -298,12 +296,12 @@ public function delete($uri)
*/
public function resetPassword($token, $password)
{
- $data = array(
- "token" => $token,
+ $data = [
+ "token" => $token,
"password" => $password,
- );
+ ];
- list ($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/users/passwords', $data);
+ list($status, $result, $headers) = $this->apiPost($this->baseApiUrl . '/v2.1/users/passwords', $data);
if ($status == 204) {
return true;
@@ -324,12 +322,12 @@ public function resetPassword($token, $password)
public function getCollection(array $queryParams = [])
{
$usersUri = $this->baseApiUrl . '/v2.1/users';
- $users = (array)json_decode(
+ $users = (array)json_decode(
$this->apiGet($usersUri, $queryParams)
);
$meta = array_pop($users);
- $collectionData = array();
+ $collectionData = [];
foreach ($users['users'] as $item) {
$user = new UserEntity($item);
diff --git a/app/src/User/UserController.php b/app/src/User/UserController.php
index 9aaf7fd67..422d6a697 100644
--- a/app/src/User/UserController.php
+++ b/app/src/User/UserController.php
@@ -1,54 +1,74 @@
get('/user/logout', array($this, 'logout'))->name('user-logout');
- $app->map('/user/login', array($this, 'login'))->via('GET', 'POST')->name('user-login');
- $app->map('/user/register', array($this, 'register'))->via('GET', 'POST')->name('user-register');
- $app->get('/user/verification', array($this, 'verification'))->name('user-verification');
- $app->map('/user/resend-verification', array($this, 'resendVerification'))
- ->via('GET', 'POST')->name('user-resend-verification');
- $app->map('/user/username-reminder', array($this, 'remindUsername'))
- ->via('GET', 'POST')->name('user-username-reminder');
- $app->map('/user/password-reset', array($this, 'resetPassword'))
- ->via('GET', 'POST')->name('user-password-reset');
- $app->map('/user/new-password', array($this, 'newPassword'))
- ->via('GET', 'POST')->name('user-new-password');
- $app->get('/user/twitter-login', array($this, 'loginWithTwitter'))->name('twitter-login');
- $app->get('/user/twitter-access', array($this, 'accessTokenFromTwitter'))->name('twitter-callback');
- $app->get('/user/facebook-access', array($this, 'accessTokenFromFacebook'))->name('facebook-callback');
- $app->get('/user/:username', array($this, 'profile'))->name('user-profile');
- $app->get('/user/:username/talks', array($this, 'profileTalks'))->name('user-profile-talks');
- $app->get('/user/:username/events', array($this, 'profileEvents'))->name('user-profile-events');
- $app->get('/user/:username/hosted', array($this, 'profileHosted'))->name('user-profile-hosted');
- $app->get('/user/:username/comments', array($this, 'profileComments'))->name('user-profile-comments');
- $app->map('/user/:username/edit', array($this, 'profileEdit'))
- ->via('GET', 'POST')->name('user-profile-edit');
- $app->get('/user/:username/delete', array($this, 'userDelete'))->name('user-profile-delete');
- $app->get('/user/view/:userId(/:extra+)', array($this, 'redirectFromId'))
+ $app->get('/user/logout', [$this, 'logout'])
+ ->name('user-logout');
+ $app->map('/user/login', [$this, 'login'])
+ ->via('GET', 'POST')
+ ->name('user-login');
+ $app->map('/user/register', [$this, 'register'])
+ ->via('GET', 'POST')
+ ->name('user-register');
+ $app->get('/user/verification', [$this, 'verification'])
+ ->name('user-verification');
+ $app->map('/user/resend-verification', [$this, 'resendVerification'])
+ ->via('GET', 'POST')
+ ->name('user-resend-verification');
+ $app->map('/user/username-reminder', [$this, 'remindUsername'])
+ ->via('GET', 'POST')
+ ->name('user-username-reminder');
+ $app->map('/user/password-reset', [$this, 'resetPassword'])
+ ->via('GET', 'POST')
+ ->name('user-password-reset');
+ $app->map('/user/new-password', [$this, 'newPassword'])
+ ->via('GET', 'POST')
+ ->name('user-new-password');
+ $app->get('/user/twitter-login', [$this, 'loginWithTwitter'])
+ ->name('twitter-login');
+ $app->get('/user/twitter-access', [$this, 'accessTokenFromTwitter'])
+ ->name('twitter-callback');
+ $app->get('/user/facebook-access', [$this, 'accessTokenFromFacebook'])
+ ->name('facebook-callback');
+ $app->get('/user/:username', [$this, 'profile'])
+ ->name('user-profile');
+ $app->get('/user/:username/talks', [$this, 'profileTalks'])
+ ->name('user-profile-talks');
+ $app->get('/user/:username/events', [$this, 'profileEvents'])
+ ->name('user-profile-events');
+ $app->get('/user/:username/hosted', [$this, 'profileHosted'])
+ ->name('user-profile-hosted');
+ $app->get('/user/:username/comments', [$this, 'profileComments'])
+ ->name('user-profile-comments');
+ $app->map('/user/:username/edit', [$this, 'profileEdit'])
+ ->via('GET', 'POST')
+ ->name('user-profile-edit');
+ $app->get('/user/:username/delete', [$this, 'userDelete'])
+ ->name('user-profile-delete');
+ $app->get('/user/view/:userId(/:extra+)', [$this, 'redirectFromId'])
->name('user-redirect-from-id')
- ->conditions(array('userId' => '\d+'));
+ ->conditions(['userId' => '\d+']);
}
/**
@@ -58,7 +78,7 @@ protected function defineRoutes(\Slim\Slim $app)
*/
public function login()
{
- $config = $this->application->config('oauth');
+ $config = $this->application->config('oauth');
$request = $this->application->request();
$error = false;
@@ -66,14 +86,14 @@ public function login()
// handle submission of login form
// make a call to the api with granttype=password
- $username = $request->post('username');
- $password = $request->post('password');
- $redirect = $request->post('redirect');
- $clientId = $config['client_id'];
+ $username = $request->post('username');
+ $password = $request->post('password');
+ $redirect = $request->post('redirect');
+ $clientId = $config['client_id'];
$clientSecret = $config['client_secret'];
$authApi = $this->application->container->get(AuthApi::class);
- $result = $authApi->login($username, $password, $clientId, $clientSecret);
+ $result = $authApi->login($username, $password, $clientId, $clientSecret);
$this->handleLogin($result, $redirect);
}
@@ -112,9 +132,9 @@ public function register()
$this->render(
'User/register.html.twig',
- array(
+ [
'form' => $form->createView(),
- )
+ ]
);
}
@@ -129,7 +149,7 @@ public function register()
*/
protected function registerUserUsingForm($form)
{
- $values = $form->getData();
+ $values = $form->getData();
$userApi = $this->getUserApi();
$result = false;
@@ -151,7 +171,7 @@ protected function registerUserUsingForm($form)
*/
public function logout()
{
- $request = $this->application->request();
+ $request = $this->application->request();
$redirect = ($request->get('redirect')) ? $request->get('redirect') : "/";
if (isset($_SESSION['user'])) {
@@ -173,7 +193,7 @@ public function verification()
{
$request = $this->application->request();
- $token = $request->get('token');
+ $token = $request->get('token');
$userApi = $this->getUserApi();
try {
@@ -199,7 +219,7 @@ public function resendVerification()
if ($form->isValid()) {
$values = $form->getData();
- $email = $values['email'];
+ $email = $values['email'];
$userApi = $this->getUserApi();
@@ -223,9 +243,9 @@ public function resendVerification()
$this->render(
'User/emailverification.html.twig',
- array(
+ [
'form' => $form->createView(),
- )
+ ]
);
}
@@ -238,20 +258,20 @@ public function resendVerification()
public function profile($username)
{
$userApi = $this->getUserApi();
- $user = $userApi->getUserByUsername($username);
+ $user = $userApi->getUserByUsername($username);
if (!$user) {
Slim::getInstance()->notFound();
}
- $talkDb = $this->getTalkDb();
- $talkApi = $this->getTalkApi();
+ $talkDb = $this->getTalkDb();
+ $talkApi = $this->getTalkApi();
$eventApi = $this->getEventApi();
- $eventInfo = array(); // look up an event's name and url_friendly_name from its uri
- $talkInfo = array(); // look up a talk's url_friendly_talk_title from its uri
+ $eventInfo = []; // look up an event's name and url_friendly_name from its uri
+ $talkInfo = []; // look up a talk's url_friendly_talk_title from its uri
$talkCollection = $talkApi->getCollection($user->getTalksUri(), ['verbose' => 'yes', 'resultsperpage' => 5]);
- $talks = false;
+ $talks = false;
if (isset($talkCollection['talks'])) {
$talks = $talkCollection['talks'];
foreach ($talks as $talk) {
@@ -288,11 +308,13 @@ public function profile($username)
$talkData = $talkDb->load('uri', $comment->getTalkUri());
if ($talkData) {
$eventUri = $talkData['event_uri'];
+
$talkInfo[$comment->getTalkUri()]['url_friendly_talk_title'] = $talkData['slug'];
} else {
$talk = $talkApi->getTalk($comment->getTalkUri());
if ($talk) {
$eventUri = $talk->getEventUri();
+
$talkInfo[$comment->getTalkUri()]['url_friendly_talk_title'] = $talk->getUrlFriendlyTalkTitle();
}
}
@@ -303,9 +325,9 @@ public function profile($username)
}
}
- echo $this->render(
+ $this->render(
'User/profile.html.twig',
- array(
+ [
'thisUser' => $user,
'talks' => $talks,
'eventInfo' => $eventInfo,
@@ -313,7 +335,7 @@ public function profile($username)
'events' => $events,
'hostedEvents' => $hostedEvents,
'talkComments' => $talkComments,
- )
+ ]
);
}
@@ -326,7 +348,7 @@ public function profile($username)
public function profileTalks($username)
{
$userApi = $this->getUserApi();
- $user = $userApi->getUserByUsername($username);
+ $user = $userApi->getUserByUsername($username);
if (!$user) {
Slim::getInstance()->notFound();
}
@@ -338,7 +360,7 @@ public function profileTalks($username)
$this->application->redirect($this->application->urlFor('user-profile', ['username' => $username]));
}
- $eventInfo = array();
+ $eventInfo = [];
if (isset($talkCollection['talks'])) {
$talks = $talkCollection['talks'];
foreach ($talks as $talk) {
@@ -349,13 +371,13 @@ public function profileTalks($username)
}
}
- echo $this->render(
+ $this->render(
'User/profile-talks.html.twig',
- array(
+ [
'thisUser' => $user,
'talks' => $talks,
'eventInfo' => $eventInfo,
- )
+ ]
);
}
@@ -368,12 +390,12 @@ public function profileTalks($username)
public function profileEvents($username)
{
$userApi = $this->getUserApi();
- $user = $userApi->getUserByUsername($username);
+ $user = $userApi->getUserByUsername($username);
if (!$user) {
Slim::getInstance()->notFound();
}
- $eventApi = $this->getEventApi();
+ $eventApi = $this->getEventApi();
$eventsCollection = $eventApi->getCollection(
$user->getAttendedEventsUri(),
['verbose' => 'yes', 'resultsperpage' => 0]
@@ -382,13 +404,13 @@ public function profileEvents($username)
$this->application->redirect($this->application->urlFor('user-profile', ['username' => $username]));
}
- echo $this->render(
+ $this->render(
'User/profile-events.html.twig',
- array(
+ [
'thisUser' => $user,
'events' => $eventsCollection['events'],
'type' => 'attended',
- )
+ ]
);
}
@@ -401,12 +423,12 @@ public function profileEvents($username)
public function profileHosted($username)
{
$userApi = $this->getUserApi();
- $user = $userApi->getUserByUsername($username);
+ $user = $userApi->getUserByUsername($username);
if (!$user) {
Slim::getInstance()->notFound();
}
- $eventApi = $this->getEventApi();
+ $eventApi = $this->getEventApi();
$hostedEventsCollection = $eventApi->getCollection(
$user->getHostedEventsUri(),
['verbose' => 'yes', 'resultsperpage' => 0]
@@ -416,13 +438,13 @@ public function profileHosted($username)
}
- echo $this->render(
+ $this->render(
'User/profile-events.html.twig',
- array(
+ [
'thisUser' => $user,
'events' => $hostedEventsCollection['events'],
'type' => 'hosted',
- )
+ ]
);
}
@@ -435,21 +457,21 @@ public function profileHosted($username)
public function profileComments($username)
{
$userApi = $this->getUserApi();
- $user = $userApi->getUserByUsername($username);
+ $user = $userApi->getUserByUsername($username);
if (!$user) {
Slim::getInstance()->notFound();
}
- $talkDb = $this->getTalkDb();
- $talkApi = $this->getTalkApi();
- $eventApi = $this->getEventApi();
+ $talkDb = $this->getTalkDb();
+ $talkApi = $this->getTalkApi();
+ $eventApi = $this->getEventApi();
$talkComments = $talkApi->getComments($user->getTalkCommentsUri(), true, 0);
if (!$talkComments) {
$this->application->redirect($this->application->urlFor('user-profile', ['username' => $username]));
}
- $talkInfo = array();
- $eventInfo = array();
+ $talkInfo = [];
+ $eventInfo = [];
foreach ($talkComments as $comment) {
if (isset($talkInfo[$comment->getTalkUri()])) {
continue;
@@ -457,11 +479,13 @@ public function profileComments($username)
$talkData = $talkDb->load('uri', $comment->getTalkUri());
if ($talkData) {
$eventUri = $talkData['event_uri'];
+
$talkInfo[$comment->getTalkUri()]['url_friendly_talk_title'] = $talkData['slug'];
} else {
$talk = $talkApi->getTalk($comment->getTalkUri());
if ($talk) {
$eventUri = $talk->getEventUri();
+
$talkInfo[$comment->getTalkUri()]['url_friendly_talk_title'] = $talk->getUrlFriendlyTalkTitle();
}
}
@@ -474,30 +498,30 @@ public function profileComments($username)
$this->render(
'User/profile-comments.html.twig',
- array(
+ [
'thisUser' => $user,
'talkComments' => $talkComments,
'eventInfo' => $eventInfo,
'talkInfo' => $talkInfo,
- )
+ ]
);
}
protected function lookupEventInfo($eventUri)
{
- $eventDb = $this->getEventDb();
+ $eventDb = $this->getEventDb();
$eventApi = $this->getEventApi();
- $eventInfo = array();
+ $eventInfo = [];
$eventData = $eventDb->load('uri', $eventUri);
if (isset($eventData['name'])) {
$eventInfo['url_friendly_name'] = $eventData['url_friendly_name'];
- $eventInfo['name'] = $eventData['name'];
+ $eventInfo['name'] = $eventData['name'];
} else {
$event = $eventApi->getEvent($eventUri);
if ($event) {
$eventInfo['url_friendly_name'] = $event->getUrlFriendlyName();
- $eventInfo['name'] = $event->getName();
+ $eventInfo['name'] = $event->getName();
}
}
@@ -557,7 +581,7 @@ public function remindUsername()
if ($form->isValid()) {
$values = $form->getData();
- $email = $values['email'];
+ $email = $values['email'];
$userApi = $this->getUserApi();
@@ -580,9 +604,9 @@ public function remindUsername()
$this->render(
'User/username-reminder.html.twig',
- array(
+ [
'form' => $form->createView(),
- )
+ ]
);
}
@@ -595,7 +619,7 @@ public function remindUsername()
public function profileEdit($username)
{
$userApi = $this->getUserApi();
- $user = $userApi->getUserByUsername($username);
+ $user = $userApi->getUserByUsername($username);
if (!$user) {
Slim::getInstance()->notFound();
}
@@ -608,12 +632,12 @@ public function profileEdit($username)
// create an array of the data to be edited for use by the form
$userData = [
- 'full_name' => $user->getFullName(),
- 'email' => $user->getEmail(),
+ 'full_name' => $user->getFullName(),
+ 'email' => $user->getEmail(),
'twitter_username' => $user->getTwitterUsername(),
- 'biography' => $user->getBiography(),
- 'old_password' => '',
- 'password' => '',
+ 'biography' => $user->getBiography(),
+ 'old_password' => '',
+ 'password' => '',
];
// can only change password if we're editing ourselves
@@ -668,18 +692,18 @@ public function profileEdit($username)
$this->render(
'User/profile-edit.html.twig',
- array(
- 'thisUser' => $user,
- 'form' => $form->createView(),
+ [
+ 'thisUser' => $user,
+ 'form' => $form->createView(),
'can_change_password' => $canChangePassword,
- )
+ ]
);
}
public function userDelete($username)
{
$userApi = $this->getUserApi();
- $user = $userApi->getUserByUsername($username);
+ $user = $userApi->getUserByUsername($username);
try {
// LDBG($values);exit;
@@ -708,7 +732,7 @@ public function resetPassword()
$form->submit($request->post($form->getName()));
if ($form->isValid()) {
- $values = $form->getData();
+ $values = $form->getData();
$username = $values['username'];
$userApi = $this->getUserApi();
@@ -732,9 +756,9 @@ public function resetPassword()
$this->render(
'User/password-reset.html.twig',
- array(
+ [
'form' => $form->createView(),
- )
+ ]
);
}
@@ -746,7 +770,7 @@ public function resetPassword()
public function newPassword()
{
$request = $this->application->request();
- $token = $request->get('token');
+ $token = $request->get('token');
/** @var FormFactoryInterface $factory */
$factory = $this->application->formFactory;
@@ -756,7 +780,7 @@ public function newPassword()
$form->submit($request->post($form->getName()));
if ($form->isValid()) {
- $values = $form->getData();
+ $values = $form->getData();
$userApi = $this->getUserApi();
try {
@@ -778,9 +802,9 @@ public function newPassword()
$this->render(
'User/new-password.html.twig',
- array(
+ [
'form' => $form->createView(),
- )
+ ]
);
}
@@ -791,11 +815,11 @@ public function newPassword()
public function loginWithTwitter()
{
// ask the API for a request token
- $config = $this->application->config('oauth');
- $clientId = $config['client_id'];
+ $config = $this->application->config('oauth');
+ $clientId = $config['client_id'];
$clientSecret = $config['client_secret'];
- $authApi = $this->application->container->get(AuthApi::class);
+ $authApi = $this->application->container->get(AuthApi::class);
$request_token = $authApi->getTwitterRequestToken($clientId, $clientSecret);
if ($request_token) {
@@ -816,19 +840,19 @@ public function loginWithTwitter()
*/
public function accessTokenFromTwitter()
{
- $config = $this->application->config('oauth');
+ $config = $this->application->config('oauth');
$request = $this->application->request();
// pass verification to the API so we can log in
- $clientId = $config['client_id'];
+ $clientId = $config['client_id'];
$clientSecret = $config['client_secret'];
// handle incoming vars
- $token = $request->get('oauth_token');
+ $token = $request->get('oauth_token');
$verifier = $request->get('oauth_verifier');
$authApi = $this->application->container->get(AuthApi::class);
- $result = $authApi->verifyTwitter($clientId, $clientSecret, $token, $verifier);
+ $result = $authApi->verifyTwitter($clientId, $clientSecret, $token, $verifier);
$this->handleLogin($result);
}
@@ -838,18 +862,18 @@ public function accessTokenFromTwitter()
*/
public function accessTokenFromFacebook()
{
- $config = $this->application->config('oauth');
+ $config = $this->application->config('oauth');
$request = $this->application->request();
// pass verification to the API so we can log in
- $clientId = $config['client_id'];
+ $clientId = $config['client_id'];
$clientSecret = $config['client_secret'];
// handle incoming vars
$code = $request->get('code');
$authApi = $this->application->container->get(AuthApi::class);
- $result = $authApi->verifyFacebook($clientId, $clientSecret, $code);
+ $result = $authApi->verifyFacebook($clientId, $clientSecret, $code);
$this->handleLogin($result);
}
@@ -858,8 +882,8 @@ public function accessTokenFromFacebook()
* Process a user login result. If result is false, then we failed, otherwise
* update the session.
*
- * @param \stdClass|false $result
- * @param string $redirect
+ * @param stdClass|false $result
+ * @param string $redirect
* @return void
*/
protected function handleLogin($result, $redirect = '')
@@ -880,7 +904,7 @@ protected function handleLogin($result, $redirect = '')
session_regenerate_id(true);
$_SESSION['access_token'] = $result->access_token;
- $this->accessToken = $_SESSION['access_token'];
+ $this->accessToken = $_SESSION['access_token'];
// now get users details
$userApi = $this->getUserApi();
@@ -903,7 +927,7 @@ protected function handleLogin($result, $redirect = '')
public function redirectFromId($userId)
{
$userApi = $this->getUserApi();
- $user = $userApi->getUserByUserId($userId);
+ $user = $userApi->getUserByUserId($userId);
if (!$user) {
return $this->application->notFound();
}
@@ -911,7 +935,7 @@ public function redirectFromId($userId)
$this->application->redirect(
$this->application->urlFor(
'user-profile',
- array('username' => $user->getUsername())
+ ['username' => $user->getUsername()]
)
);
}
diff --git a/app/src/User/UserDb.php b/app/src/User/UserDb.php
index 5b20a0d8a..196482781 100644
--- a/app/src/User/UserDb.php
+++ b/app/src/User/UserDb.php
@@ -1,8 +1,8 @@
$user->getUri(),
- 'username' => $user->getUsername(),
- 'slug' => $user->getUsername(),
- 'verbose_uri' => $user->getVerboseUri()
- );
+ $data = [
+ 'uri' => $user->getUri(),
+ 'username' => $user->getUsername(),
+ 'slug' => $user->getUsername(),
+ 'verbose_uri' => $user->getVerboseUri()
+ ];
$savedUser = $this->load('uri', $user->getUri());
if ($savedUser) {
diff --git a/app/src/User/UserEntity.php b/app/src/User/UserEntity.php
index c70c0153b..da0d68e95 100644
--- a/app/src/User/UserEntity.php
+++ b/app/src/User/UserEntity.php
@@ -1,8 +1,8 @@
data->uri;
+ $uri = $this->data->uri;
$parts = explode('/', $uri);
return $parts[5];
diff --git a/app/src/User/UserFormType.php b/app/src/User/UserFormType.php
index 7236d48a0..8857fba36 100644
--- a/app/src/User/UserFormType.php
+++ b/app/src/User/UserFormType.php
@@ -1,8 +1,12 @@
add(
'full_name',
- 'text',
+ TextType::class,
[
- 'required' => true,
+ 'required' => true,
'constraints' => [new Assert\NotBlank()],
]
)
->add(
'email',
- 'text',
+ TextType::class,
[
- 'required' => true,
+ 'required' => true,
'constraints' => [new Assert\NotBlank(), new Assert\Email()],
]
)
->add(
'twitter_username',
- 'text',
+ TextType::class,
[
- 'required' => false,
+ 'required' => false,
'empty_data' => '',
// 'constraints' => [new Assert\NotBlank(), new Assert\Email()],
]
)
->add(
'biography',
- 'textarea',
+ TextareaType::class,
[
- 'required' => false,
+ 'required' => false,
'empty_data' => '',
- 'attr' => [
- 'rows' => 4,
+ 'attr' => [
+ 'rows' => 4,
'maxlength' => '400'
]
]
@@ -84,23 +88,23 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$builder
->add(
'old_password',
- 'password',
+ PasswordType::class,
[
- 'label' => 'Current password',
+ 'label' => 'Current password',
'required' => false,
// 'constraints' => [new Assert\NotBlank(), new Assert\Email()],
]
)
->add(
'password',
- 'repeated',
+ RepeatedType::class,
[
- 'type' => 'password',
+ 'type' => 'password',
'invalid_message' => 'The password fields must match.',
- 'required' => false,
- 'first_options' => array('label' => 'New password'),
- 'second_options' => array('label' => 'Repeat new password'),
- 'constraints' => [new Assert\Length(['min' => 6])],
+ 'required' => false,
+ 'first_options' => ['label' => 'New password'],
+ 'second_options' => ['label' => 'Repeat new password'],
+ 'constraints' => [new Assert\Length(['min' => 6])],
]
);
}
diff --git a/app/src/User/UsernameInputFormType.php b/app/src/User/UsernameInputFormType.php
index 41c1820f0..98865d721 100644
--- a/app/src/User/UsernameInputFormType.php
+++ b/app/src/User/UsernameInputFormType.php
@@ -1,8 +1,9 @@
add(
'username',
- 'text',
+ TextType::class,
[
- 'required' => true,
+ 'required' => true,
'constraints' => [new Assert\NotBlank()],
]
)
diff --git a/app/src/View/FiltersExtension.php b/app/src/View/FiltersExtension.php
index b6f57aa0b..cb3cc5cb1 100644
--- a/app/src/View/FiltersExtension.php
+++ b/app/src/View/FiltersExtension.php
@@ -1,26 +1,27 @@
true]
),
- new Twig_SimpleFilter(
+ new TwigFilter(
'link',
[$this, 'link'],
['is_safe' => ['html']]
),
- new Twig_SimpleFilter(
+ new TwigFilter(
'format_date',
[$this, 'formatDate']
)
@@ -28,14 +29,14 @@ public function getFilters()
}
/**
- * @param Twig_Environment $env
- * @param string $suffix
- * @param string $infix
+ * @param Environment $env
+ * @param string $suffix
+ * @param string $infix
*
* @return string
* @throws \Twig_Error_Runtime
*/
- public function imgPath(Twig_Environment $env, $suffix, $infix)
+ public function imgPath(Environment $env, $suffix, $infix)
{
if (!$suffix && $infix = 'event_icons') {
$suffix = 'none.png';
diff --git a/app/src/View/FunctionsExtension.php b/app/src/View/FunctionsExtension.php
index 46b26e20d..64bc4723e 100644
--- a/app/src/View/FunctionsExtension.php
+++ b/app/src/View/FunctionsExtension.php
@@ -1,12 +1,12 @@
app;
return [
- new Twig_SimpleFunction('urlFor', function ($routeName, $params = array()) use ($app) {
+ new TwigFunction('urlFor', function ($routeName, $params = []) use ($app) {
$url = rtrim($app->urlFor($routeName, $params), '/');
return $url;
}),
- new Twig_SimpleFunction('hash', function ($value) {
+ new TwigFunction('hash', function ($value) {
return md5($value);
}),
- new Twig_SimpleFunction('gravatar', function ($email_hash, $size = 40) {
+ new TwigFunction('gravatar', function ($email_hash, $size = 40) {
$size = ((int)$size == 0) ? 20 : (int)$size;
$url = 'https://secure.gravatar.com/avatar/' . $email_hash . '?d=mm&s=' . $size;
@@ -50,11 +50,11 @@ public function getFunctions()
return $url;
}),
- new Twig_SimpleFunction('getCurrentRoute', function () use ($app) {
+ new TwigFunction('getCurrentRoute', function () use ($app) {
return $app->router->getCurrentRoute()->getName();
}),
- new Twig_SimpleFunction('getCurrentUrl', function ($fullyQualified = false) use ($app) {
+ new TwigFunction('getCurrentUrl', function ($fullyQualified = false) use ($app) {
$url = $_SERVER['REQUEST_URI'];
if ($fullyQualified) {
@@ -67,25 +67,25 @@ public function getFunctions()
return $url;
}),
- new Twig_SimpleFunction('urlForTalk', function ($eventSlug, $talkSlug, $params = array()) use ($app) {
- return $app->urlFor('talk', array('eventSlug' => $eventSlug, 'talkSlug' => $talkSlug));
+ new TwigFunction('urlForTalk', function ($eventSlug, $talkSlug, $params = []) use ($app) {
+ return $app->urlFor('talk', ['eventSlug' => $eventSlug, 'talkSlug' => $talkSlug]);
}),
- new Twig_SimpleFunction('shortUrlForTalk', function ($talkStub) use ($app) {
+ new TwigFunction('shortUrlForTalk', function ($talkStub) use ($app) {
$scheme = $app->request()->getScheme();
$host = $app->request()->headers('host');
- return "$scheme://$host" . $app->urlFor('talk-quicklink', array('talkStub' => $talkStub));
+ return "$scheme://$host" . $app->urlFor('talk-quicklink', ['talkStub' => $talkStub]);
}),
- new Twig_SimpleFunction('shortUrlForEvent', function ($eventStub) use ($app) {
+ new TwigFunction('shortUrlForEvent', function ($eventStub) use ($app) {
$scheme = $app->request()->getScheme();
$host = $app->request()->headers('host');
- return "$scheme://$host" . $app->urlFor('event-quicklink', array('stub' => $eventStub));
+ return "$scheme://$host" . $app->urlFor('event-quicklink', ['stub' => $eventStub]);
}),
- new Twig_SimpleFunction(
+ new TwigFunction(
'dateRange',
function ($start, $end, $format = 'd.m.Y', $separator = ' - ') {
$formatter = new \Org_Heigl\DateRange\DateRangeFormatter();
@@ -111,7 +111,7 @@ function ($start, $end, $format = 'd.m.Y', $separator = ' - ') {
* - 120 minutes converts to "2 hours"
* - 126 minutes converts to "2 hours, 6 minutes"
*/
- new Twig_SimpleFunction('prettyDuration', function ($duration) {
+ new TwigFunction('prettyDuration', function ($duration) {
$duration = (int)$duration;
if ($duration < 60) {
@@ -140,7 +140,7 @@ function ($start, $end, $format = 'd.m.Y', $separator = ' - ') {
/**
* wrapped Slim request function getPath()
*/
- new Twig_SimpleFunction('currentPath', function () use ($app) {
+ new TwigFunction('currentPath', function () use ($app) {
$request = $app->request;
$params = $app->request->get();
$queryString = http_build_query($params);
@@ -155,7 +155,7 @@ function ($start, $end, $format = 'd.m.Y', $separator = ' - ') {
/**
* Create link to log in with Facebook
*/
- new Twig_SimpleFunction(
+ new TwigFunction(
'facebookLoginUrl',
function () use ($app) {
if (!$app->config('facebook') || empty($app->config('facebook')['app_id'])) {
@@ -182,7 +182,7 @@ function () use ($app) {
/**
* Create a link to download a QR-Code for the given URL
*/
- new Twig_SimpleFunction('qrcode', function ($url) {
+ new TwigFunction('qrcode', function ($url) {
return sprintf(
'https://chart.googleapis.com/chart?cht=qr&chs=300x300&chl=%s&choe=UTF-8&chld=H',
urlencode($url . '?qr')
diff --git a/build.xml b/build.xml
index a3e757298..e131b41dc 100644
--- a/build.xml
+++ b/build.xml
@@ -32,7 +32,7 @@
-
+
diff --git a/composer.json b/composer.json
index a49836d7d..c064dfb50 100644
--- a/composer.json
+++ b/composer.json
@@ -2,20 +2,13 @@
"name": "joindin/website",
"license": "BSD-3-Clause",
"autoload": {
- "psr-0":{
- "Application": ["app/src/", "tests/"],
- "Form": ["app/src/", "tests/"],
- "Language": ["app/src/", "tests/"],
- "Middleware": ["app/src/", "tests/"],
- "Event": ["app/src/", "tests/"],
- "Search": ["app/src/", "tests/"],
- "Talk": ["app/src/", "tests/"],
- "User": ["app/src/", "tests/"],
- "Client": ["app/src/", "tests/"],
- "Apikey": ["app/src/", "tests/"],
- "View": ["app/src/", "tests/"]
+ "psr-4":{
+ "JoindIn\\Web\\": "app/src/"
}
},
+ "autoload-dev": {
+ "psr-4": { "JoindIn\\Web\\": "tests/" }
+ },
"config": {
"platform": {
"php": "7.3.2"
@@ -26,24 +19,33 @@
},
"minimum-stability": "stable",
"require": {
- "guzzlehttp/guzzle": "^6.2.1",
- "monolog/monolog": "^1.21",
- "org_heigl/daterange": "~1.1",
- "predis/predis": "~0.8",
- "slim/slim": "~2.4",
- "slim/views": "~0.1",
- "symfony/form": "~2.8",
- "symfony/validator": "~2.8",
- "symfony/security-csrf": "~2.8",
- "symfony/twig-bridge": "~2.8",
- "twig/twig": "~1.15"
+ "ext-json": "*",
+ "guzzlehttp/guzzle": "^6.2.1",
+ "monolog/monolog": "^1.21",
+ "org_heigl/daterange": "~1.1",
+ "predis/predis": "~0.8",
+ "slim/slim": "~2.4",
+ "slim/views": "~0.1",
+ "symfony/console": "^3.4",
+ "symfony/form": "^3.4",
+ "symfony/inflector": "^3.4",
+ "symfony/intl": "^3.4",
+ "symfony/options-resolver": "^3.4",
+ "symfony/property-access": "^3.4",
+ "symfony/security-core": "^3.4",
+ "symfony/security-csrf": "^3.4",
+ "symfony/translation": "^3.4",
+ "symfony/twig-bridge": "^3.4",
+ "symfony/validator": "^3.4",
+ "twig/twig": "~1.15"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "^1.0",
"phpunit/phpunit": "^8.0",
"roave/security-advisories": "dev-master",
"sensiolabs/security-checker": "^5.0",
- "squizlabs/php_codesniffer": "^3.4"
+ "squizlabs/php_codesniffer": "^3.4",
+ "symfony/debug": "^3.4"
},
"scripts": {
"test": "phpunit -c . tests/",
@@ -59,7 +61,8 @@
"@lint",
"@sniff",
"@security",
- "@test"
+ "@test",
+ "@coverage"
]
}
}
diff --git a/composer.lock b/composer.lock
index 63b5df924..f378e2552 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "7685dcaf3216227865baecf08aeb4410",
+ "content-hash": "9791671e0682c8ff0fc89bb302247df6",
"packages": [
{
"name": "guzzlehttp/guzzle",
@@ -321,33 +321,29 @@
},
{
"name": "paragonie/random_compat",
- "version": "v2.0.18",
+ "version": "v9.99.99",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
- "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db"
+ "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/paragonie/random_compat/zipball/0a58ef6e3146256cc3dc7cc393927bcc7d1b72db",
- "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db",
+ "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
+ "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
"shasum": ""
},
"require": {
- "php": ">=5.2.0"
+ "php": "^7"
},
"require-dev": {
- "phpunit/phpunit": "4.*|5.*"
+ "phpunit/phpunit": "4.*|5.*",
+ "vimeo/psalm": "^1"
},
"suggest": {
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
},
"type": "library",
- "autoload": {
- "files": [
- "lib/random.php"
- ]
- },
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
@@ -366,7 +362,7 @@
"pseudorandom",
"random"
],
- "time": "2019-01-03T20:59:08+00:00"
+ "time": "2018-07-02T15:55:56+00:00"
},
{
"name": "predis/predis",
@@ -655,29 +651,246 @@
],
"time": "2014-12-09T23:48:51+00:00"
},
+ {
+ "name": "symfony/console",
+ "version": "v3.4.28",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/console.git",
+ "reference": "8e1d1e406dd31727fa70cd5a99cda202e9d6a5c6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/console/zipball/8e1d1e406dd31727fa70cd5a99cda202e9d6a5c6",
+ "reference": "8e1d1e406dd31727fa70cd5a99cda202e9d6a5c6",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/debug": "~2.8|~3.0|~4.0",
+ "symfony/polyfill-mbstring": "~1.0"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<3.4",
+ "symfony/process": "<3.3"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/config": "~3.3|~4.0",
+ "symfony/dependency-injection": "~3.4|~4.0",
+ "symfony/event-dispatcher": "~2.8|~3.0|~4.0",
+ "symfony/lock": "~3.4|~4.0",
+ "symfony/process": "~3.3|~4.0"
+ },
+ "suggest": {
+ "psr/log": "For using the console logger",
+ "symfony/event-dispatcher": "",
+ "symfony/lock": "",
+ "symfony/process": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Console\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Console Component",
+ "homepage": "https://symfony.com",
+ "time": "2019-05-09T08:42:51+00:00"
+ },
+ {
+ "name": "symfony/contracts",
+ "version": "v1.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/contracts.git",
+ "reference": "2d19b12caccbd80cf0c85624dc87b7021a0df1d5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/contracts/zipball/2d19b12caccbd80cf0c85624dc87b7021a0df1d5",
+ "reference": "2d19b12caccbd80cf0c85624dc87b7021a0df1d5",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3"
+ },
+ "replace": {
+ "symfony/cache-contracts": "self.version",
+ "symfony/event-dispatcher-contracts": "self.version",
+ "symfony/http-client-contracts": "self.version",
+ "symfony/service-contracts": "self.version",
+ "symfony/translation-contracts": "self.version"
+ },
+ "require-dev": {
+ "psr/cache": "^1.0",
+ "psr/container": "^1.0",
+ "symfony/polyfill-intl-idn": "^1.10"
+ },
+ "suggest": {
+ "psr/cache": "When using the Cache contracts",
+ "psr/container": "When using the Service contracts",
+ "psr/event-dispatcher": "When using the EventDispatcher contracts",
+ "symfony/cache-implementation": "",
+ "symfony/event-dispatcher-implementation": "",
+ "symfony/http-client-implementation": "",
+ "symfony/service-implementation": "",
+ "symfony/translation-implementation": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Contracts\\": ""
+ },
+ "exclude-from-classmap": [
+ "**/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "A set of abstractions extracted out of the Symfony components",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "time": "2019-06-05T13:28:50+00:00"
+ },
+ {
+ "name": "symfony/debug",
+ "version": "v3.4.28",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "671fc55bd14800668b1d0a3708c3714940e30a8c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/671fc55bd14800668b1d0a3708c3714940e30a8c",
+ "reference": "671fc55bd14800668b1d0a3708c3714940e30a8c",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8",
+ "psr/log": "~1.0"
+ },
+ "conflict": {
+ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
+ },
+ "require-dev": {
+ "symfony/http-kernel": "~2.8|~3.0|~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Debug\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Debug Component",
+ "homepage": "https://symfony.com",
+ "time": "2019-05-18T13:32:47+00:00"
+ },
{
"name": "symfony/event-dispatcher",
- "version": "v3.0.9",
+ "version": "v4.3.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "54da3ff63dec3c9c0e32ec3f95a7d94ef64baa00"
+ "reference": "4e6c670af81c4fb0b6c08b035530a9915d0b691f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/54da3ff63dec3c9c0e32ec3f95a7d94ef64baa00",
- "reference": "54da3ff63dec3c9c0e32ec3f95a7d94ef64baa00",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4e6c670af81c4fb0b6c08b035530a9915d0b691f",
+ "reference": "4e6c670af81c4fb0b6c08b035530a9915d0b691f",
"shasum": ""
},
"require": {
- "php": ">=5.5.9"
+ "php": "^7.1.3",
+ "symfony/event-dispatcher-contracts": "^1.1"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<3.4"
+ },
+ "provide": {
+ "psr/event-dispatcher-implementation": "1.0",
+ "symfony/event-dispatcher-implementation": "1.1"
},
"require-dev": {
"psr/log": "~1.0",
- "symfony/config": "~2.8|~3.0",
- "symfony/dependency-injection": "~2.8|~3.0",
- "symfony/expression-language": "~2.8|~3.0",
- "symfony/stopwatch": "~2.8|~3.0"
+ "symfony/config": "~3.4|~4.0",
+ "symfony/dependency-injection": "~3.4|~4.0",
+ "symfony/expression-language": "~3.4|~4.0",
+ "symfony/http-foundation": "^3.4|^4.0",
+ "symfony/service-contracts": "^1.1",
+ "symfony/stopwatch": "~3.4|~4.0"
},
"suggest": {
"symfony/dependency-injection": "",
@@ -686,7 +899,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-master": "4.3-dev"
}
},
"autoload": {
@@ -713,45 +926,50 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2016-07-19T10:44:15+00:00"
+ "time": "2019-05-30T16:10:05+00:00"
},
{
"name": "symfony/form",
- "version": "v2.8.49",
+ "version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/form.git",
- "reference": "74382a47aa97496d181fbb598822fdfb9e1744e4"
+ "reference": "ce56406a0ac22a5b199236253c39f3b080b93d0e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/form/zipball/74382a47aa97496d181fbb598822fdfb9e1744e4",
- "reference": "74382a47aa97496d181fbb598822fdfb9e1744e4",
+ "url": "https://api.github.com/repos/symfony/form/zipball/ce56406a0ac22a5b199236253c39f3b080b93d0e",
+ "reference": "ce56406a0ac22a5b199236253c39f3b080b93d0e",
"shasum": ""
},
"require": {
- "php": ">=5.3.9",
- "symfony/event-dispatcher": "~2.1|~3.0.0",
- "symfony/intl": "~2.7.25|^2.8.18|~3.2.5",
- "symfony/options-resolver": "~2.6",
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/event-dispatcher": "~2.8|~3.0|~4.0",
+ "symfony/intl": "^2.8.18|^3.2.5|~4.0",
+ "symfony/options-resolver": "~3.4|~4.0",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/property-access": "~2.3|~3.0.0"
+ "symfony/property-access": "~2.8|~3.0|~4.0"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
+ "symfony/dependency-injection": "<3.3",
"symfony/doctrine-bridge": "<2.7",
- "symfony/framework-bundle": "<2.7",
- "symfony/twig-bridge": "<2.7"
+ "symfony/framework-bundle": "<3.4",
+ "symfony/http-kernel": "<3.3.5",
+ "symfony/twig-bridge": "<3.4.5|<4.0.5,>=4.0"
},
"require-dev": {
"doctrine/collections": "~1.0",
- "symfony/dependency-injection": "~2.7|~3.0.0",
- "symfony/http-foundation": "~2.2|~3.0.0",
- "symfony/http-kernel": "~2.4|~3.0.0",
- "symfony/security-csrf": "^2.8.31|^3.3.13",
- "symfony/translation": "^2.0.5|~3.0.0",
- "symfony/validator": "^2.8.18|~3.2.5"
+ "symfony/config": "~2.7|~3.0|~4.0",
+ "symfony/console": "~3.4|~4.0",
+ "symfony/dependency-injection": "~3.3|~4.0",
+ "symfony/http-foundation": "~2.8|~3.0|~4.0",
+ "symfony/http-kernel": "^3.3.5|~4.0",
+ "symfony/security-csrf": "^2.8.31|^3.3.13|~4.0",
+ "symfony/translation": "~2.8|~3.0|~4.0",
+ "symfony/validator": "^3.2.5|~4.0",
+ "symfony/var-dumper": "~3.3.11|~3.4|~4.0"
},
"suggest": {
"symfony/framework-bundle": "For templating with PHP.",
@@ -762,7 +980,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.8-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -789,28 +1007,86 @@
],
"description": "Symfony Form Component",
"homepage": "https://symfony.com",
- "time": "2018-12-06T11:12:46+00:00"
+ "time": "2019-05-14T14:13:30+00:00"
+ },
+ {
+ "name": "symfony/inflector",
+ "version": "v3.4.28",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/inflector.git",
+ "reference": "4a7d5c4ad3edeba3fe4a27d26ece6a012eee46b1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/inflector/zipball/4a7d5c4ad3edeba3fe4a27d26ece6a012eee46b1",
+ "reference": "4a7d5c4ad3edeba3fe4a27d26ece6a012eee46b1",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/polyfill-ctype": "~1.8"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Inflector\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Inflector Component",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "inflection",
+ "pluralize",
+ "singularize",
+ "string",
+ "symfony",
+ "words"
+ ],
+ "time": "2019-01-16T13:27:11+00:00"
},
{
"name": "symfony/intl",
- "version": "v3.2.14",
+ "version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/intl.git",
- "reference": "3fd98dde8e7d1c34c974d65b09e9c32abe88dafe"
+ "reference": "3217e574d10034bd27f8bcd4f02d6e4c34edfc42"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/intl/zipball/3fd98dde8e7d1c34c974d65b09e9c32abe88dafe",
- "reference": "3fd98dde8e7d1c34c974d65b09e9c32abe88dafe",
+ "url": "https://api.github.com/repos/symfony/intl/zipball/3217e574d10034bd27f8bcd4f02d6e4c34edfc42",
+ "reference": "3217e574d10034bd27f8bcd4f02d6e4c34edfc42",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
+ "php": "^5.5.9|>=7.0.8",
"symfony/polyfill-intl-icu": "~1.0"
},
"require-dev": {
- "symfony/filesystem": "~2.8|~3.0"
+ "symfony/filesystem": "~2.8|~3.0|~4.0"
},
"suggest": {
"ext-intl": "to use the component with locales other than \"en\""
@@ -818,7 +1094,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -864,29 +1140,29 @@
"l10n",
"localization"
],
- "time": "2017-11-16T17:55:54+00:00"
+ "time": "2019-05-09T08:31:33+00:00"
},
{
"name": "symfony/options-resolver",
- "version": "v2.8.49",
+ "version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
- "reference": "7aaab725bb58f0e18aa12c61bdadd4793ab4c32b"
+ "reference": "ed3b397f9c07c8ca388b2a1ef744403b4d4ecc44"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7aaab725bb58f0e18aa12c61bdadd4793ab4c32b",
- "reference": "7aaab725bb58f0e18aa12c61bdadd4793ab4c32b",
+ "url": "https://api.github.com/repos/symfony/options-resolver/zipball/ed3b397f9c07c8ca388b2a1ef744403b4d4ecc44",
+ "reference": "ed3b397f9c07c8ca388b2a1ef744403b4d4ecc44",
"shasum": ""
},
"require": {
- "php": ">=5.3.9"
+ "php": "^5.5.9|>=7.0.8"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.8-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -918,20 +1194,20 @@
"configuration",
"options"
],
- "time": "2018-11-11T11:18:13+00:00"
+ "time": "2019-04-10T16:00:48+00:00"
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.10.0",
+ "version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
+ "reference": "82ebae02209c21113908c229e9883c419720738a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19",
- "reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a",
+ "reference": "82ebae02209c21113908c229e9883c419720738a",
"shasum": ""
},
"require": {
@@ -943,7 +1219,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.9-dev"
+ "dev-master": "1.11-dev"
}
},
"autoload": {
@@ -965,7 +1241,7 @@
},
{
"name": "Gert de Pagter",
- "email": "backendtea@gmail.com"
+ "email": "BackEndTea@gmail.com"
}
],
"description": "Symfony polyfill for ctype functions",
@@ -976,20 +1252,20 @@
"polyfill",
"portable"
],
- "time": "2018-08-06T14:22:27+00:00"
+ "time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/polyfill-intl-icu",
- "version": "v1.10.0",
+ "version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-icu.git",
- "reference": "f22a90256d577c7ef7efad8df1f0201663d57644"
+ "reference": "999878a3a09d73cae157b0cf89bb6fb2cc073057"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/f22a90256d577c7ef7efad8df1f0201663d57644",
- "reference": "f22a90256d577c7ef7efad8df1f0201663d57644",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/999878a3a09d73cae157b0cf89bb6fb2cc073057",
+ "reference": "999878a3a09d73cae157b0cf89bb6fb2cc073057",
"shasum": ""
},
"require": {
@@ -1034,20 +1310,20 @@
"portable",
"shim"
],
- "time": "2018-08-06T14:22:27+00:00"
+ "time": "2019-01-07T19:39:47+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.10.0",
+ "version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "c79c051f5b3a46be09205c73b80b346e4153e494"
+ "reference": "fe5e94c604826c35a32fa832f35bd036b6799609"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494",
- "reference": "c79c051f5b3a46be09205c73b80b346e4153e494",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609",
+ "reference": "fe5e94c604826c35a32fa832f35bd036b6799609",
"shasum": ""
},
"require": {
@@ -1059,7 +1335,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.9-dev"
+ "dev-master": "1.11-dev"
}
},
"autoload": {
@@ -1093,20 +1369,20 @@
"portable",
"shim"
],
- "time": "2018-09-21T13:07:52+00:00"
+ "time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/polyfill-php56",
- "version": "v1.10.0",
+ "version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php56.git",
- "reference": "ff208829fe1aa48ab9af356992bb7199fed551af"
+ "reference": "f4dddbc5c3471e1b700a147a20ae17cdb72dbe42"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/ff208829fe1aa48ab9af356992bb7199fed551af",
- "reference": "ff208829fe1aa48ab9af356992bb7199fed551af",
+ "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/f4dddbc5c3471e1b700a147a20ae17cdb72dbe42",
+ "reference": "f4dddbc5c3471e1b700a147a20ae17cdb72dbe42",
"shasum": ""
},
"require": {
@@ -1116,7 +1392,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.9-dev"
+ "dev-master": "1.11-dev"
}
},
"autoload": {
@@ -1149,20 +1425,20 @@
"portable",
"shim"
],
- "time": "2018-09-21T06:26:08+00:00"
+ "time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/polyfill-php70",
- "version": "v1.10.0",
+ "version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php70.git",
- "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224"
+ "reference": "bc4858fb611bda58719124ca079baff854149c89"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224",
- "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224",
+ "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/bc4858fb611bda58719124ca079baff854149c89",
+ "reference": "bc4858fb611bda58719124ca079baff854149c89",
"shasum": ""
},
"require": {
@@ -1172,7 +1448,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.9-dev"
+ "dev-master": "1.11-dev"
}
},
"autoload": {
@@ -1208,20 +1484,20 @@
"portable",
"shim"
],
- "time": "2018-09-21T06:26:08+00:00"
+ "time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/polyfill-util",
- "version": "v1.10.0",
+ "version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-util.git",
- "reference": "3b58903eae668d348a7126f999b0da0f2f93611c"
+ "reference": "b46c6cae28a3106735323f00a0c38eccf2328897"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/3b58903eae668d348a7126f999b0da0f2f93611c",
- "reference": "3b58903eae668d348a7126f999b0da0f2f93611c",
+ "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/b46c6cae28a3106735323f00a0c38eccf2328897",
+ "reference": "b46c6cae28a3106735323f00a0c38eccf2328897",
"shasum": ""
},
"require": {
@@ -1230,7 +1506,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.9-dev"
+ "dev-master": "1.11-dev"
}
},
"autoload": {
@@ -1260,29 +1536,37 @@
"polyfill",
"shim"
],
- "time": "2018-09-30T16:36:12+00:00"
+ "time": "2019-02-08T14:16:39+00:00"
},
{
"name": "symfony/property-access",
- "version": "v3.0.9",
+ "version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/property-access.git",
- "reference": "a4f1a668d0a269a65790f07d9ab2a97dd060fccb"
+ "reference": "9b1c9df96a00c14445bef4cf37ad85e7239d8a4a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/property-access/zipball/a4f1a668d0a269a65790f07d9ab2a97dd060fccb",
- "reference": "a4f1a668d0a269a65790f07d9ab2a97dd060fccb",
+ "url": "https://api.github.com/repos/symfony/property-access/zipball/9b1c9df96a00c14445bef4cf37ad85e7239d8a4a",
+ "reference": "9b1c9df96a00c14445bef4cf37ad85e7239d8a4a",
"shasum": ""
},
"require": {
- "php": ">=5.5.9"
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/inflector": "~3.1|~4.0",
+ "symfony/polyfill-php70": "~1.0"
+ },
+ "require-dev": {
+ "symfony/cache": "~3.1|~4.0"
+ },
+ "suggest": {
+ "psr/cache-implementation": "To cache access methods."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -1320,20 +1604,20 @@
"property path",
"reflection"
],
- "time": "2016-07-30T07:22:48+00:00"
+ "time": "2019-03-04T06:36:31+00:00"
},
{
"name": "symfony/security-core",
- "version": "v3.4.22",
+ "version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/security-core.git",
- "reference": "816ba9bacc8ba5303f250597b2c9af380d9d715b"
+ "reference": "eebbb6e8bdeb31c32a3eaece502f89f5d5690960"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/security-core/zipball/816ba9bacc8ba5303f250597b2c9af380d9d715b",
- "reference": "816ba9bacc8ba5303f250597b2c9af380d9d715b",
+ "url": "https://api.github.com/repos/symfony/security-core/zipball/eebbb6e8bdeb31c32a3eaece502f89f5d5690960",
+ "reference": "eebbb6e8bdeb31c32a3eaece502f89f5d5690960",
"shasum": ""
},
"require": {
@@ -1387,33 +1671,33 @@
],
"description": "Symfony Security Component - Core Library",
"homepage": "https://symfony.com",
- "time": "2019-01-31T10:03:47+00:00"
+ "time": "2019-05-05T16:11:06+00:00"
},
{
"name": "symfony/security-csrf",
- "version": "v2.8.49",
+ "version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/security-csrf.git",
- "reference": "91957524d5e01416a2e6ece04667f2060f717a76"
+ "reference": "76ae1a389baca0375dd0a21c1f33fae901ad6cb0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/security-csrf/zipball/91957524d5e01416a2e6ece04667f2060f717a76",
- "reference": "91957524d5e01416a2e6ece04667f2060f717a76",
+ "url": "https://api.github.com/repos/symfony/security-csrf/zipball/76ae1a389baca0375dd0a21c1f33fae901ad6cb0",
+ "reference": "76ae1a389baca0375dd0a21c1f33fae901ad6cb0",
"shasum": ""
},
"require": {
- "php": ">=5.3.9",
+ "php": "^5.5.9|>=7.0.8",
"symfony/polyfill-php56": "~1.0",
"symfony/polyfill-php70": "~1.0",
- "symfony/security-core": "^2.8.41|^3.3.17"
+ "symfony/security-core": "~2.8|~3.0|~4.0"
},
"conflict": {
- "symfony/http-foundation": "<2.7.38|~2.8,<2.8.31|~3.3,<3.3.13"
+ "symfony/http-foundation": "<2.8.31|~3.3,<3.3.13"
},
"require-dev": {
- "symfony/http-foundation": "^2.7.38|~3.3.13"
+ "symfony/http-foundation": "^2.8.31|~3.3.13|~3.4|~4.0"
},
"suggest": {
"symfony/http-foundation": "For using the class SessionTokenStorage."
@@ -1421,7 +1705,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.8-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -1448,44 +1732,50 @@
],
"description": "Symfony Security Component - CSRF Library",
"homepage": "https://symfony.com",
- "time": "2018-11-11T11:18:13+00:00"
+ "time": "2019-01-16T09:39:14+00:00"
},
{
"name": "symfony/translation",
- "version": "v3.0.9",
+ "version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26"
+ "reference": "301a5d627220a1c4ee522813b0028653af6c4f54"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26",
- "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/301a5d627220a1c4ee522813b0028653af6c4f54",
+ "reference": "301a5d627220a1c4ee522813b0028653af6c4f54",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
+ "php": "^5.5.9|>=7.0.8",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
- "symfony/config": "<2.8"
+ "symfony/config": "<2.8",
+ "symfony/dependency-injection": "<3.4",
+ "symfony/yaml": "<3.4"
},
"require-dev": {
"psr/log": "~1.0",
- "symfony/config": "~2.8|~3.0",
- "symfony/intl": "~2.8|~3.0",
- "symfony/yaml": "~2.8|~3.0"
+ "symfony/config": "~2.8|~3.0|~4.0",
+ "symfony/dependency-injection": "~3.4|~4.0",
+ "symfony/finder": "~2.8|~3.0|~4.0",
+ "symfony/http-kernel": "~3.4|~4.0",
+ "symfony/intl": "^2.8.18|^3.2.5|~4.0",
+ "symfony/var-dumper": "~3.4|~4.0",
+ "symfony/yaml": "~3.4|~4.0"
},
"suggest": {
- "psr/log": "To use logging capability in translator",
+ "psr/log-implementation": "To use logging capability in translator",
"symfony/config": "",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -1512,46 +1802,50 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
- "time": "2016-07-30T07:22:48+00:00"
+ "time": "2019-05-01T11:10:09+00:00"
},
{
"name": "symfony/twig-bridge",
- "version": "v2.8.49",
+ "version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/twig-bridge.git",
- "reference": "ecc1e30d05fa99f25b504e2d6a8684555ae39f7c"
+ "reference": "9fc026c05e927fe59cf89f67b9f9926e44301eea"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/ecc1e30d05fa99f25b504e2d6a8684555ae39f7c",
- "reference": "ecc1e30d05fa99f25b504e2d6a8684555ae39f7c",
+ "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/9fc026c05e927fe59cf89f67b9f9926e44301eea",
+ "reference": "9fc026c05e927fe59cf89f67b9f9926e44301eea",
"shasum": ""
},
"require": {
- "php": ">=5.3.9",
- "twig/twig": "~1.34|~2.4"
+ "php": "^5.5.9|>=7.0.8",
+ "twig/twig": "^1.40|^2.9"
},
"conflict": {
- "symfony/form": "<2.8.23"
+ "symfony/console": "<3.4",
+ "symfony/form": "<3.4.13|>=4.0,<4.0.13|>=4.1,<4.1.2"
},
"require-dev": {
- "symfony/asset": "~2.7|~3.0.0",
- "symfony/console": "~2.8|~3.0.0",
- "symfony/expression-language": "~2.4|~3.0.0",
- "symfony/finder": "~2.3|~3.0.0",
- "symfony/form": "^2.8.23",
- "symfony/http-foundation": "^2.8.29|~3.0.0",
- "symfony/http-kernel": "~2.8|~3.0.0",
+ "symfony/asset": "~2.8|~3.0|~4.0",
+ "symfony/console": "~3.4|~4.0",
+ "symfony/dependency-injection": "~2.8|~3.0|~4.0",
+ "symfony/expression-language": "~2.8|~3.0|~4.0",
+ "symfony/finder": "~2.8|~3.0|~4.0",
+ "symfony/form": "^3.4.23|^4.2.4",
+ "symfony/http-foundation": "^3.3.11|~4.0",
+ "symfony/http-kernel": "~3.2|~4.0",
"symfony/polyfill-intl-icu": "~1.0",
- "symfony/routing": "~2.2|~3.0.0",
- "symfony/security": "^2.8.31|^3.3.13",
- "symfony/security-acl": "~2.6|~3.0.0",
- "symfony/stopwatch": "~2.2|~3.0.0",
- "symfony/templating": "~2.1|~3.0.0",
- "symfony/translation": "~2.7|~3.0.0",
- "symfony/var-dumper": "~2.7.16|~2.8.9|~3.0.9",
- "symfony/yaml": "^2.0.5|~3.0.0"
+ "symfony/routing": "~2.8|~3.0|~4.0",
+ "symfony/security": "^2.8.31|^3.3.13|~4.0",
+ "symfony/security-acl": "~2.8|~3.0",
+ "symfony/stopwatch": "~2.8|~3.0|~4.0",
+ "symfony/templating": "~2.8|~3.0|~4.0",
+ "symfony/translation": "~2.8|~3.0|~4.0",
+ "symfony/var-dumper": "~2.8.10|~3.1.4|~3.2|~4.0",
+ "symfony/web-link": "~3.3|~4.0",
+ "symfony/workflow": "~3.3|~4.0",
+ "symfony/yaml": "~2.8|~3.0|~4.0"
},
"suggest": {
"symfony/asset": "For using the AssetExtension",
@@ -1565,12 +1859,13 @@
"symfony/templating": "For using the TwigEngine",
"symfony/translation": "For using the TranslationExtension",
"symfony/var-dumper": "For using the DumpExtension",
+ "symfony/web-link": "For using the WebLinkExtension",
"symfony/yaml": "For using the YamlExtension"
},
"type": "symfony-bridge",
"extra": {
"branch-alias": {
- "dev-master": "2.8-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -1597,54 +1892,65 @@
],
"description": "Symfony Twig Bridge",
"homepage": "https://symfony.com",
- "time": "2018-11-11T11:18:13+00:00"
+ "time": "2019-04-30T12:26:26+00:00"
},
{
"name": "symfony/validator",
- "version": "v2.8.49",
+ "version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/validator.git",
- "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a"
+ "reference": "23cf394faaffb6257f5764fbfc2db12ec30956f1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/validator/zipball/d5d2090bba3139d8ddb79959fbf516e87238fe3a",
- "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a",
+ "url": "https://api.github.com/repos/symfony/validator/zipball/23cf394faaffb6257f5764fbfc2db12ec30956f1",
+ "reference": "23cf394faaffb6257f5764fbfc2db12ec30956f1",
"shasum": ""
},
"require": {
- "php": ">=5.3.9",
+ "php": "^5.5.9|>=7.0.8",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/translation": "~2.4|~3.0.0"
+ "symfony/translation": "~2.8|~3.0|~4.0"
+ },
+ "conflict": {
+ "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
+ "symfony/dependency-injection": "<3.3",
+ "symfony/http-kernel": "<3.3.5",
+ "symfony/yaml": "<3.4"
},
"require-dev": {
"doctrine/annotations": "~1.0",
"doctrine/cache": "~1.0",
- "egulias/email-validator": "^1.2.1",
- "symfony/config": "~2.2|~3.0.0",
- "symfony/expression-language": "~2.4|~3.0.0",
- "symfony/http-foundation": "~2.3|~3.0.0",
- "symfony/intl": "~2.7.25|^2.8.18|~3.2.5",
- "symfony/property-access": "~2.3|~3.0.0",
- "symfony/yaml": "^2.0.5|~3.0.0"
+ "egulias/email-validator": "^1.2.8|~2.0",
+ "symfony/cache": "~3.1|~4.0",
+ "symfony/config": "~2.8|~3.0|~4.0",
+ "symfony/dependency-injection": "~3.3|~4.0",
+ "symfony/expression-language": "~2.8|~3.0|~4.0",
+ "symfony/http-foundation": "~2.8|~3.0|~4.0",
+ "symfony/http-kernel": "^3.3.5|~4.0",
+ "symfony/intl": "^2.8.18|^3.2.5|~4.0",
+ "symfony/property-access": "~2.8|~3.0|~4.0",
+ "symfony/var-dumper": "~3.3|~4.0",
+ "symfony/yaml": "~3.4|~4.0"
},
"suggest": {
"doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.",
"doctrine/cache": "For using the default cached annotation reader and metadata cache.",
"egulias/email-validator": "Strict (RFC compliant) email validation",
+ "psr/cache-implementation": "For using the metadata cache.",
"symfony/config": "",
- "symfony/expression-language": "For using the 2.4 Expression validator",
+ "symfony/expression-language": "For using the Expression validator",
"symfony/http-foundation": "",
"symfony/intl": "",
- "symfony/property-access": "For using the 2.4 Validator API",
+ "symfony/property-access": "For accessing properties within comparison constraints",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.8-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -1671,20 +1977,20 @@
],
"description": "Symfony Validator Component",
"homepage": "https://symfony.com",
- "time": "2018-11-14T14:06:48+00:00"
+ "time": "2019-05-05T16:11:06+00:00"
},
{
"name": "twig/twig",
- "version": "v1.38.2",
+ "version": "v1.42.1",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
- "reference": "874adbd9222f928f6998732b25b01b41dff15b0c"
+ "reference": "671347603760a88b1e7288aaa9378f33687d7edf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/874adbd9222f928f6998732b25b01b41dff15b0c",
- "reference": "874adbd9222f928f6998732b25b01b41dff15b0c",
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/671347603760a88b1e7288aaa9378f33687d7edf",
+ "reference": "671347603760a88b1e7288aaa9378f33687d7edf",
"shasum": ""
},
"require": {
@@ -1694,12 +2000,12 @@
"require-dev": {
"psr/container": "^1.0",
"symfony/debug": "^2.7",
- "symfony/phpunit-bridge": "^3.4.19|^4.1.8"
+ "symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.38-dev"
+ "dev-master": "1.42-dev"
}
},
"autoload": {
@@ -1737,7 +2043,7 @@
"keywords": [
"templating"
],
- "time": "2019-03-12T18:45:24+00:00"
+ "time": "2019-06-04T11:31:08+00:00"
}
],
"packages-dev": [
@@ -1799,27 +2105,29 @@
},
{
"name": "doctrine/instantiator",
- "version": "1.1.0",
+ "version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
- "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
+ "reference": "a2c590166b2133a4633738648b6b064edae0814a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
- "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a",
+ "reference": "a2c590166b2133a4633738648b6b064edae0814a",
"shasum": ""
},
"require": {
"php": "^7.1"
},
"require-dev": {
- "athletic/athletic": "~0.1.8",
+ "doctrine/coding-standard": "^6.0",
"ext-pdo": "*",
"ext-phar": "*",
- "phpunit/phpunit": "^6.2.3",
- "squizlabs/php_codesniffer": "^3.0.2"
+ "phpbench/phpbench": "^0.13",
+ "phpstan/phpstan-phpunit": "^0.11",
+ "phpstan/phpstan-shim": "^0.11",
+ "phpunit/phpunit": "^7.0"
},
"type": "library",
"extra": {
@@ -1844,12 +2152,12 @@
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
- "homepage": "https://github.com/doctrine/instantiator",
+ "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
"keywords": [
"constructor",
"instantiate"
],
- "time": "2017-07-22T11:58:36+00:00"
+ "time": "2019-03-17T17:37:11+00:00"
},
{
"name": "jakub-onderka/php-parallel-lint",
@@ -1901,16 +2209,16 @@
},
{
"name": "myclabs/deep-copy",
- "version": "1.8.1",
+ "version": "1.9.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8"
+ "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8",
- "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72",
+ "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72",
"shasum": ""
},
"require": {
@@ -1945,7 +2253,7 @@
"object",
"object graph"
],
- "time": "2018-06-11T23:09:50+00:00"
+ "time": "2019-04-07T13:18:21+00:00"
},
{
"name": "phar-io/manifest",
@@ -2105,16 +2413,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "4.3.0",
+ "version": "4.3.1",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "94fd0001232e47129dd3504189fa1c7225010d08"
+ "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08",
- "reference": "94fd0001232e47129dd3504189fa1c7225010d08",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c",
+ "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c",
"shasum": ""
},
"require": {
@@ -2152,7 +2460,7 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
- "time": "2017-11-30T07:14:17+00:00"
+ "time": "2019-04-30T17:48:53+00:00"
},
{
"name": "phpdocumentor/type-resolver",
@@ -2266,16 +2574,16 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "7.0.3",
+ "version": "7.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "0317a769a81845c390e19684d9ba25d7f6aa4707"
+ "reference": "aed67b57d459dcab93e84a5c9703d3deb5025dff"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0317a769a81845c390e19684d9ba25d7f6aa4707",
- "reference": "0317a769a81845c390e19684d9ba25d7f6aa4707",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aed67b57d459dcab93e84a5c9703d3deb5025dff",
+ "reference": "aed67b57d459dcab93e84a5c9703d3deb5025dff",
"shasum": ""
},
"require": {
@@ -2325,7 +2633,7 @@
"testing",
"xunit"
],
- "time": "2019-02-26T07:38:26+00:00"
+ "time": "2019-06-06T12:28:18+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -2420,16 +2728,16 @@
},
{
"name": "phpunit/php-timer",
- "version": "2.1.1",
+ "version": "2.1.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059"
+ "reference": "1038454804406b0b5f5f520358e78c1c2f71501e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b389aebe1b8b0578430bda0c7c95a829608e059",
- "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e",
+ "reference": "1038454804406b0b5f5f520358e78c1c2f71501e",
"shasum": ""
},
"require": {
@@ -2465,7 +2773,7 @@
"keywords": [
"timer"
],
- "time": "2019-02-20T10:12:59+00:00"
+ "time": "2019-06-07T04:22:29+00:00"
},
{
"name": "phpunit/php-token-stream",
@@ -2518,42 +2826,43 @@
},
{
"name": "phpunit/phpunit",
- "version": "8.0.5",
+ "version": "8.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "19cbed2120839772c4a00e8b28456b0c77d1a7b4"
+ "reference": "047f771e34dccacb6c432a1a70e9980e087eac92"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/19cbed2120839772c4a00e8b28456b0c77d1a7b4",
- "reference": "19cbed2120839772c4a00e8b28456b0c77d1a7b4",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/047f771e34dccacb6c432a1a70e9980e087eac92",
+ "reference": "047f771e34dccacb6c432a1a70e9980e087eac92",
"shasum": ""
},
"require": {
- "doctrine/instantiator": "^1.1",
+ "doctrine/instantiator": "^1.2.0",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"ext-xmlwriter": "*",
- "myclabs/deep-copy": "^1.7",
- "phar-io/manifest": "^1.0.2",
- "phar-io/version": "^2.0",
+ "myclabs/deep-copy": "^1.9.1",
+ "phar-io/manifest": "^1.0.3",
+ "phar-io/version": "^2.0.1",
"php": "^7.2",
- "phpspec/prophecy": "^1.7",
- "phpunit/php-code-coverage": "^7.0",
- "phpunit/php-file-iterator": "^2.0.1",
+ "phpspec/prophecy": "^1.8.0",
+ "phpunit/php-code-coverage": "^7.0.5",
+ "phpunit/php-file-iterator": "^2.0.2",
"phpunit/php-text-template": "^1.2.1",
- "phpunit/php-timer": "^2.1",
- "sebastian/comparator": "^3.0",
- "sebastian/diff": "^3.0",
- "sebastian/environment": "^4.1",
- "sebastian/exporter": "^3.1",
- "sebastian/global-state": "^3.0",
+ "phpunit/php-timer": "^2.1.2",
+ "sebastian/comparator": "^3.0.2",
+ "sebastian/diff": "^3.0.2",
+ "sebastian/environment": "^4.2.2",
+ "sebastian/exporter": "^3.1.0",
+ "sebastian/global-state": "^3.0.0",
"sebastian/object-enumerator": "^3.0.3",
- "sebastian/resource-operations": "^2.0",
+ "sebastian/resource-operations": "^2.0.1",
+ "sebastian/type": "^1.1.0",
"sebastian/version": "^2.0.1"
},
"require-dev": {
@@ -2562,7 +2871,7 @@
"suggest": {
"ext-soap": "*",
"ext-xdebug": "*",
- "phpunit/php-invoker": "^2.0"
+ "phpunit/php-invoker": "^2.0.0"
},
"bin": [
"phpunit"
@@ -2570,7 +2879,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "8.0-dev"
+ "dev-master": "8.2-dev"
}
},
"autoload": {
@@ -2596,7 +2905,7 @@
"testing",
"xunit"
],
- "time": "2019-03-16T07:33:46+00:00"
+ "time": "2019-06-07T14:04:13+00:00"
},
{
"name": "roave/security-advisories",
@@ -2604,12 +2913,12 @@
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
- "reference": "018ec51b676a4d1efc971950d1d9619570b71676"
+ "reference": "4c0ba8a35f1f12dd9236452e9fae4346b0bf2a56"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/018ec51b676a4d1efc971950d1d9619570b71676",
- "reference": "018ec51b676a4d1efc971950d1d9619570b71676",
+ "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/4c0ba8a35f1f12dd9236452e9fae4346b0bf2a56",
+ "reference": "4c0ba8a35f1f12dd9236452e9fae4346b0bf2a56",
"shasum": ""
},
"conflict": {
@@ -2623,14 +2932,14 @@
"aws/aws-sdk-php": ">=3,<3.2.1",
"brightlocal/phpwhois": "<=4.2.5",
"bugsnag/bugsnag-laravel": ">=2,<2.0.2",
- "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4|>=3.4,<3.4.14|>=3.5,<3.5.17|>=3.6,<3.6.4",
+ "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7",
"cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4",
"cartalyst/sentry": "<=2.1.6",
"codeigniter/framework": "<=3.0.6",
- "composer/composer": "<=1.0.0-alpha11",
+ "composer/composer": "<=1-alpha.11",
"contao-components/mediaelement": ">=2.14.2,<2.21.1",
- "contao/core": ">=2,<3.5.35",
- "contao/core-bundle": ">=4,<4.4.18|>=4.5,<4.5.8",
+ "contao/core": ">=2,<3.5.39",
+ "contao/core-bundle": ">=4,<4.4.39|>=4.5,<4.7.5",
"contao/listing-bundle": ">=4,<4.4.8",
"contao/newsletter-bundle": ">=4,<4.1",
"david-garcia/phpwhois": "<=4.3.1",
@@ -2644,9 +2953,9 @@
"doctrine/mongodb-odm-bundle": ">=2,<3.0.1",
"doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1",
"dompdf/dompdf": ">=0.6,<0.6.2",
- "drupal/core": ">=7,<7.64|>=8,<8.5.13|>=8.6,<8.6.12",
- "drupal/drupal": ">=7,<7.64|>=8,<8.5.13|>=8.6,<8.6.12",
- "erusev/parsedown": "<1.7",
+ "drupal/core": ">=7,<7.67|>=8,<8.6.16|>=8.7,<8.7.1",
+ "drupal/drupal": ">=7,<7.67|>=8,<8.6.16|>=8.7,<8.7.1",
+ "erusev/parsedown": "<1.7.2",
"ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1",
"ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.12.3|>=2011,<2017.12.4.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3",
"ezsystems/repository-forms": ">=2.3,<2.3.2.1",
@@ -2659,7 +2968,7 @@
"fuel/core": "<1.8.1",
"gree/jose": "<=2.2",
"gregwar/rst": "<1.0.3",
- "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1",
+ "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1",
"illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10",
"illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30",
"illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29",
@@ -2674,9 +2983,9 @@
"laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30",
"laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10",
"league/commonmark": "<0.18.3",
- "magento/magento1ce": "<1.9.4",
- "magento/magento1ee": ">=1.9,<1.14.4",
- "magento/product-community-edition": ">=2,<2.2.7",
+ "magento/magento1ce": "<1.9.4.1",
+ "magento/magento1ee": ">=1.9,<1.14.4.1",
+ "magento/product-community-edition": ">=2,<2.2.8|>=2.3,<2.3.1",
"monolog/monolog": ">=1.8,<1.12",
"namshi/jose": "<2.2",
"onelogin/php-saml": "<2.10.4",
@@ -2694,7 +3003,7 @@
"phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3",
"phpwhois/phpwhois": "<=4.2.5",
"phpxmlrpc/extras": "<0.6.1",
- "propel/propel": ">=2.0.0-alpha1,<=2.0.0-alpha7",
+ "propel/propel": ">=2-alpha.1,<=2-alpha.7",
"propel/propel1": ">=1,<=1.7.1",
"pusher/pusher-php-server": "<2.2.1",
"robrichards/xmlseclibs": ">=1,<3.0.2",
@@ -2708,7 +3017,7 @@
"silverstripe/userforms": "<3",
"simple-updates/phpwhois": "<=1",
"simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4",
- "simplesamlphp/simplesamlphp": "<1.16.3",
+ "simplesamlphp/simplesamlphp": "<1.15.2|>=1.16,<1.16.3",
"simplesamlphp/simplesamlphp-module-infocard": "<1.0.1",
"slim/slim": "<2.6",
"smarty/smarty": "<3.1.33",
@@ -2718,39 +3027,45 @@
"stormpath/sdk": ">=0,<9.9.99",
"swiftmailer/swiftmailer": ">=4,<5.4.5",
"sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2",
- "sylius/sylius": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2",
- "symfony/dependency-injection": ">=2,<2.0.17",
+ "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1",
+ "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1",
+ "sylius/sylius": ">=1,<1.1.18|>=1.2,<1.2.17|>=1.3,<1.3.12|>=1.4,<1.4.4",
+ "symfony/cache": ">=3.2,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
+ "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
"symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1",
- "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2",
- "symfony/http-foundation": ">=2,<2.7.49|>=2.8,<2.8.44|>=3,<3.3.18|>=3.4,<3.4.14|>=4,<4.0.14|>=4.1,<4.1.3",
+ "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
+ "symfony/http-foundation": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
"symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8",
"symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13",
+ "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
"symfony/polyfill": ">=1,<1.10",
"symfony/polyfill-php55": ">=1,<1.10",
+ "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
"symfony/routing": ">=2,<2.0.19",
- "symfony/security": ">=2,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.19|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1",
+ "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
"symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
"symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7",
"symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
"symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
- "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1",
+ "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
"symfony/serializer": ">=2,<2.0.11",
- "symfony/symfony": ">=2,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1",
+ "symfony/symfony": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7",
"symfony/translation": ">=2,<2.0.17",
"symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3",
"symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4",
"symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7",
"tecnickcom/tcpdf": "<6.2.22",
"thelia/backoffice-default-template": ">=2.1,<2.1.2",
- "thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3",
+ "thelia/thelia": ">=2.1-beta.1,<2.1.3",
"theonedemon/phpwhois": "<=4.2.5",
"titon/framework": ">=0,<9.9.99",
"truckersmp/phpwhois": "<=4.3.1",
"twig/twig": "<1.38|>=2,<2.7",
- "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.23|>=9,<9.5.4",
- "typo3/cms-core": ">=8,<8.7.23|>=9,<9.5.4",
+ "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.25|>=9,<9.5.6",
+ "typo3/cms-core": ">=8,<8.7.25|>=9,<9.5.6",
"typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5",
"typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4",
+ "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1",
"ua-parser/uap-php": "<3.8",
"wallabag/tcpdf": "<6.2.22",
"willdurand/js-translation-bundle": "<2.1.1",
@@ -2766,6 +3081,7 @@
"zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2",
"zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2",
"zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5",
+ "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3",
"zendframework/zend-diactoros": ">=1,<1.8.4",
"zendframework/zend-feed": ">=1,<2.10.3",
"zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1",
@@ -2800,7 +3116,7 @@
}
],
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
- "time": "2019-03-22T05:18:50+00:00"
+ "time": "2019-05-23T20:42:12+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
@@ -2969,16 +3285,16 @@
},
{
"name": "sebastian/environment",
- "version": "4.1.0",
+ "version": "4.2.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "6fda8ce1974b62b14935adc02a9ed38252eca656"
+ "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6fda8ce1974b62b14935adc02a9ed38252eca656",
- "reference": "6fda8ce1974b62b14935adc02a9ed38252eca656",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404",
+ "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404",
"shasum": ""
},
"require": {
@@ -2993,7 +3309,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.1-dev"
+ "dev-master": "4.2-dev"
}
},
"autoload": {
@@ -3018,7 +3334,7 @@
"environment",
"hhvm"
],
- "time": "2019-02-01T05:27:49+00:00"
+ "time": "2019-05-05T09:05:15+00:00"
},
{
"name": "sebastian/exporter",
@@ -3328,6 +3644,52 @@
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
"time": "2018-10-04T04:07:39+00:00"
},
+ {
+ "name": "sebastian/type",
+ "version": "1.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/type.git",
+ "reference": "b2a7f9aac51ce18cd7ac8b31e37c8ce5646fc741"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b2a7f9aac51ce18cd7ac8b31e37c8ce5646fc741",
+ "reference": "b2a7f9aac51ce18cd7ac8b31e37c8ce5646fc741",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the types of the PHP type system",
+ "homepage": "https://github.com/sebastianbergmann/type",
+ "time": "2019-06-08T04:53:27+00:00"
+ },
{
"name": "sebastian/version",
"version": "2.0.1",
@@ -3419,16 +3781,16 @@
},
{
"name": "squizlabs/php_codesniffer",
- "version": "3.4.1",
+ "version": "3.4.2",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa"
+ "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5b4333b4010625d29580eb4a41f1e53251be6baa",
- "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
+ "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
"shasum": ""
},
"require": {
@@ -3466,148 +3828,20 @@
"phpcs",
"standards"
],
- "time": "2019-03-19T03:22:27+00:00"
- },
- {
- "name": "symfony/console",
- "version": "v3.4.22",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/console.git",
- "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/069bf3f0e8f871a2169a06e43d9f3f03f355e9be",
- "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be",
- "shasum": ""
- },
- "require": {
- "php": "^5.5.9|>=7.0.8",
- "symfony/debug": "~2.8|~3.0|~4.0",
- "symfony/polyfill-mbstring": "~1.0"
- },
- "conflict": {
- "symfony/dependency-injection": "<3.4",
- "symfony/process": "<3.3"
- },
- "provide": {
- "psr/log-implementation": "1.0"
- },
- "require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "~3.3|~4.0",
- "symfony/dependency-injection": "~3.4|~4.0",
- "symfony/event-dispatcher": "~2.8|~3.0|~4.0",
- "symfony/lock": "~3.4|~4.0",
- "symfony/process": "~3.3|~4.0"
- },
- "suggest": {
- "psr/log": "For using the console logger",
- "symfony/event-dispatcher": "",
- "symfony/lock": "",
- "symfony/process": ""
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Console\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Console Component",
- "homepage": "https://symfony.com",
- "time": "2019-01-25T10:42:12+00:00"
- },
- {
- "name": "symfony/debug",
- "version": "v3.4.22",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/debug.git",
- "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8",
- "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8",
- "shasum": ""
- },
- "require": {
- "php": "^5.5.9|>=7.0.8",
- "psr/log": "~1.0"
- },
- "conflict": {
- "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
- },
- "require-dev": {
- "symfony/http-kernel": "~2.8|~3.0|~4.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Debug\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Debug Component",
- "homepage": "https://symfony.com",
- "time": "2019-01-25T10:19:25+00:00"
+ "time": "2019-04-10T23:49:02+00:00"
},
{
"name": "theseer/tokenizer",
- "version": "1.1.0",
+ "version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/theseer/tokenizer.git",
- "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b"
+ "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b",
- "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/1c42705be2b6c1de5904f8afacef5895cab44bf8",
+ "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8",
"shasum": ""
},
"require": {
@@ -3634,7 +3868,7 @@
}
],
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
- "time": "2017-04-07T12:08:54+00:00"
+ "time": "2019-04-04T09:56:43+00:00"
},
{
"name": "webmozart/assert",
@@ -3695,7 +3929,9 @@
},
"prefer-stable": false,
"prefer-lowest": false,
- "platform": [],
+ "platform": {
+ "ext-json": "*"
+ },
"platform-dev": [],
"platform-overrides": {
"php": "7.3.2"
diff --git a/tests/Application/ConfigTest.php b/tests/Application/ConfigTest.php
index 6b035d4e6..601f682be 100644
--- a/tests/Application/ConfigTest.php
+++ b/tests/Application/ConfigTest.php
@@ -1,7 +1,8 @@
config = new Config(
[
- 'db' => 'mysql',
- 'engine' => 'fast',
- 'testing' => true,
+ 'db' => 'mysql',
+ 'engine' => 'fast',
+ 'testing' => true,
'another setting' => 17,
]
);
@@ -45,7 +46,7 @@ public function testConfigExistsReturnsCorrectBool(): void
public function testConfigCanGetSetting($settings, $key, $expected): void
{
$config = new Config($settings);
- $value = $config->offsetGet($key);
+ $value = $config->offsetGet($key);
$this->assertEquals($expected, $value);
}
diff --git a/tests/Event/EventApiTest.php b/tests/Event/EventApiTest.php
index 712c51f8c..9a5e1d3df 100644
--- a/tests/Event/EventApiTest.php
+++ b/tests/Event/EventApiTest.php
@@ -1,5 +1,5 @@
mockConfig = array('apiUrl' => 'http://example.com');
+ $this->mockConfig = ['apiUrl' => 'http://example.com'];
$this->mockPredisClient = $this->getMockBuilder(Client::class)
->getMock();
- $this->mockCache = $this->getMockBuilder('Application\CacheService')
- ->setConstructorArgs(array($this->mockPredisClient))
+ $this->mockCache = $this->getMockBuilder('JoindIn\Web\Application\CacheService')
+ ->setConstructorArgs([$this->mockPredisClient])
->getMock();
- $this->mockDbEvent = $this->getMockBuilder('Event\EventDb')
- ->setConstructorArgs(array($this->mockCache))
+ $this->mockDbEvent = $this->getMockBuilder('JoindIn\Web\Event\EventDb')
+ ->setConstructorArgs([$this->mockCache])
->getMock();
- $this->mockUserDb = $this->getMockBuilder('User\UserDb')
- ->setConstructorArgs(array($this->mockCache))
+ $this->mockUserDb = $this->getMockBuilder('JoindIn\Web\User\UserDb')
+ ->setConstructorArgs([$this->mockCache])
->getMock();
- $this->mockUserApi = $this->getMockBuilder('User\UserApi')
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockUserDb))
+ $this->mockUserApi = $this->getMockBuilder('JoindIn\Web\User\UserApi')
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockUserDb])
->getMock();
}
public function testDefaultgetEventsParametersAreSet(): void
{
- $mockEvent = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiGet'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEvent = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiGet'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock()
;
@@ -49,89 +49,89 @@ public function testDefaultgetEventsParametersAreSet(): void
$mockEvent->expects($this->once())
->method('apiGet')
->with('http://example.com/v2.1/events', $expectedParams)
- ->will($this->returnValue(json_encode(array('events' => array(), 'meta' => array()))));
+ ->will($this->returnValue(json_encode(['events' => [], 'meta' => []])));
$mockEvent->getEvents();
}
public function testgetEventsWithLimitSetsParamsCorrectly(): void
{
- $mockEvent = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiGet'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEvent = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiGet'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$expectedParams = ['resultsperpage' => 75, 'start' => 1];
$mockEvent->expects($this->once())
->method('apiGet')
->with('http://example.com/v2.1/events', $expectedParams)
- ->will($this->returnValue(json_encode(array('events' => array(), 'meta' => array()))));
+ ->will($this->returnValue(json_encode(['events' => [], 'meta' => []])));
$mockEvent->getEvents(75);
}
public function testgetEventsWithPageValueSetsParamsCorrectly(): void
{
- $mockEvent = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiGet'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEvent = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiGet'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$expectedParams = ['resultsperpage' => 32, 'start' => 6];
$mockEvent->expects($this->once())
->method('apiGet')
->with('http://example.com/v2.1/events', $expectedParams)
- ->will($this->returnValue(json_encode(array('events' => array(), 'meta' => array()))));
+ ->will($this->returnValue(json_encode(['events' => [], 'meta' => []])));
$mockEvent->getEvents(32, 6);
}
public function testgetEventsWithFilterSetsAllParamsCorrectly(): void
{
- $mockEvent = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiGet'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEvent = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiGet'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$expectedParams = ['resultsperpage' => 16, 'start' => 3, 'filter' => 'samoflange'];
$mockEvent->expects($this->once())
->method('apiGet')
->with('http://example.com/v2.1/events', $expectedParams)
- ->will($this->returnValue(json_encode(array('events' => array(), 'meta' => array()))));
+ ->will($this->returnValue(json_encode(['events' => [], 'meta' => []])));
$mockEvent->getEvents(16, 3, 'samoflange');
}
public function testgetEventsWithVerboseSetsAllParamsCorrectly(): void
{
- $mockEvent = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiGet'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEvent = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiGet'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$expectedParams = ['resultsperpage' => 16, 'start' => 3, 'verbose' => 'yes'];
$mockEvent->expects($this->once())
->method('apiGet')
->with('http://example.com/v2.1/events', $expectedParams)
- ->will($this->returnValue(json_encode(array('events' => array(), 'meta' => array()))));
+ ->will($this->returnValue(json_encode(['events' => [], 'meta' => []])));
$mockEvent->getEvents(16, 3, null, true);
}
public function testgetEventsWithQueryParamsPassesThemThroughCorrectly(): void
{
- $mockEvent = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiGet'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEvent = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiGet'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$expectedParams = ['resultsperpage' => 16, 'start' => 3, 'title' => 'test', 'tags' => 'php'];
$mockEvent->expects($this->once())
->method('apiGet')
->with('http://example.com/v2.1/events', $expectedParams)
- ->will($this->returnValue(json_encode(array('events' => array(), 'meta' => array()))));
+ ->will($this->returnValue(json_encode(['events' => [], 'meta' => []])));
- $mockEvent->getEvents(16, 3, null, false, array('title' => 'test', 'tags' => 'php'));
+ $mockEvent->getEvents(16, 3, null, false, ['title' => 'test', 'tags' => 'php']);
}
/**
@@ -141,11 +141,11 @@ public function testAddCommentPostsAComment(): void
{
// The object containing the event details (in this case, we only
// need to mock the comments_uri and its getter
- $mockEventObj = $this->getMockBuilder('Event\EventEntity')
- ->setMethods(array('getCommentsUri'))
- ->setConstructorArgs(array(
- (object) array('comments_uri'=>'http://example.com/comments/123')
- ))
+ $mockEventObj = $this->getMockBuilder('JoindIn\Web\Event\EventEntity')
+ ->setMethods(['getCommentsUri'])
+ ->setConstructorArgs([
+ (object) ['comments_uri' =>'http://example.com/comments/123']
+ ])
->getMock();
$mockEventObj->expects($this->once())
@@ -156,21 +156,21 @@ public function testAddCommentPostsAComment(): void
// We need to create the Event API class, and mock the call to the
// joind.in API to return a known result and check we're making the
// correct call
- $mockEventApi = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiPost'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEventApi = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiPost'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$mockEventApi->expects($this->once())
->method('apiPost')
->with(
'http://example.com/comments/123',
- array(
+ [
'comment' => 'comment',
- 'rating' => 3,
- )
+ 'rating' => 3,
+ ]
)
- ->will($this->returnValue(array('201', 'result')));
+ ->will($this->returnValue(['201', 'result']));
// The test
$this->assertTrue(
@@ -185,11 +185,11 @@ public function testPostCommentThrowsExceptionIfAPIReturnsBadStatus(): void
{
// The object containing the event details (in this case, we only
// need to mock the comments_uri and its getter
- $mockEventObj = $this->getMockBuilder('Event\EventEntity')
- ->setMethods(array('getCommentsUri'))
- ->setConstructorArgs(array(
- (object) array('comments_uri'=>'http://example.com/comments/123')
- ))
+ $mockEventObj = $this->getMockBuilder('JoindIn\Web\Event\EventEntity')
+ ->setMethods(['getCommentsUri'])
+ ->setConstructorArgs([
+ (object) ['comments_uri' =>'http://example.com/comments/123']
+ ])
->getMock();
$mockEventObj->expects($this->once())
@@ -200,21 +200,21 @@ public function testPostCommentThrowsExceptionIfAPIReturnsBadStatus(): void
// We need to create the Event API class, and mock the call to the
// joind.in API to return a known (failed) result and check we're making the
// correct call
- $mockEventApi = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiPost'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEventApi = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiPost'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$mockEventApi->expects($this->once())
->method('apiPost')
->with(
'http://example.com/comments/123',
- array(
+ [
'comment' => 'comment',
- 'rating' => 0,
- )
+ 'rating' => 0,
+ ]
)
- ->will($this->returnValue(array('500', 'no result')));
+ ->will($this->returnValue(['500', 'no result']));
// The test
$this->expectException('Exception');
@@ -223,11 +223,11 @@ public function testPostCommentThrowsExceptionIfAPIReturnsBadStatus(): void
public function testAttendThrowsExceptionIfAPIReturnsBadStatus(): void
{
- $mockEventObj = $this->getMockBuilder('Event\EventEntity')
- ->setMethods(array('getApiUriToMarkAsAttending'))
- ->setConstructorArgs(array(
- (object) array('attending_uri'=>'http://example.com/events/1/attending')
- ))
+ $mockEventObj = $this->getMockBuilder('JoindIn\Web\Event\EventEntity')
+ ->setMethods(['getApiUriToMarkAsAttending'])
+ ->setConstructorArgs([
+ (object) ['attending_uri' =>'http://example.com/events/1/attending']
+ ])
->getMock();
$mockEventObj->expects($this->once())
@@ -235,9 +235,9 @@ public function testAttendThrowsExceptionIfAPIReturnsBadStatus(): void
->will($this->returnValue('http://example.com/events/1/attending'));
- $mockEventApi = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiPost'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEventApi = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiPost'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$mockEventApi->expects($this->once())
@@ -245,7 +245,7 @@ public function testAttendThrowsExceptionIfAPIReturnsBadStatus(): void
->with(
'http://example.com/events/1/attending'
)
- ->will($this->returnValue(array('500', 'no result')));
+ ->will($this->returnValue(['500', 'no result']));
$this->expectException('Exception');
$mockEventApi->attend($mockEventObj);
@@ -254,15 +254,15 @@ public function testAttendThrowsExceptionIfAPIReturnsBadStatus(): void
public function testDefaultGetTalkCommentsParametersAreSet(): void
{
$comment_uri = 'http://example.com/v2.1/events/1/talk_comments';
- $mockEvent = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiGet'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEvent = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiGet'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$mockEvent->expects($this->once())
->method('apiGet')
->with('http://example.com/v2.1/events/1/talk_comments?resultsperpage=10&start=1')
- ->will($this->returnValue(json_encode(array('comments' => array(), 'meta' => array()))));
+ ->will($this->returnValue(json_encode(['comments' => [], 'meta' => []])));
$mockEvent->getTalkComments($comment_uri);
}
@@ -270,15 +270,15 @@ public function testDefaultGetTalkCommentsParametersAreSet(): void
public function testGetTalkCommentsWithLimitSetsParamsCorrectly(): void
{
$comment_uri = 'http://example.com/v2.1/events/1/talk_comments';
- $mockEvent = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiGet'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEvent = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiGet'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$mockEvent->expects($this->once())
->method('apiGet')
->with('http://example.com/v2.1/events/1/talk_comments?resultsperpage=75&start=1')
- ->will($this->returnValue(json_encode(array('comments' => array(), 'meta' => array()))));
+ ->will($this->returnValue(json_encode(['comments' => [], 'meta' => []])));
$mockEvent->getTalkComments($comment_uri, 75);
}
@@ -286,15 +286,15 @@ public function testGetTalkCommentsWithLimitSetsParamsCorrectly(): void
public function testGetTalkCommentsWithStartValueSetsParamsCorrectly(): void
{
$comment_uri = 'http://example.com/v2.1/events/1/talk_comments';
- $mockEvent = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiGet'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEvent = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiGet'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$mockEvent->expects($this->once())
->method('apiGet')
->with('http://example.com/v2.1/events/1/talk_comments?resultsperpage=32&start=6')
- ->will($this->returnValue(json_encode(array('comments' => array(), 'meta' => array()))));
+ ->will($this->returnValue(json_encode(['comments' => [], 'meta' => []])));
$mockEvent->getTalkComments($comment_uri, 32, 6);
}
@@ -302,15 +302,15 @@ public function testGetTalkCommentsWithStartValueSetsParamsCorrectly(): void
public function testGetTalkCommentsWithVerboseSetsAllParamsCorrectly(): void
{
$comment_uri = 'http://example.com/v2.1/events/1/talk_comments';
- $mockEvent = $this->getMockBuilder('Event\EventApi')
- ->setMethods(array('apiGet'))
- ->setConstructorArgs(array($this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi))
+ $mockEvent = $this->getMockBuilder('JoindIn\Web\Event\EventApi')
+ ->setMethods(['apiGet'])
+ ->setConstructorArgs([$this->mockConfig, null, $this->mockDbEvent, $this->mockUserApi])
->getMock();
$mockEvent->expects($this->once())
->method('apiGet')
->with('http://example.com/v2.1/events/1/talk_comments?resultsperpage=16&start=3&verbose=yes')
- ->will($this->returnValue(json_encode(array('comments' => array(), 'meta' => array()))));
+ ->will($this->returnValue(json_encode(['comments' => [], 'meta' => []])));
$mockEvent->getTalkComments($comment_uri, 16, 3, true);
}
diff --git a/tests/Event/EventCommentEntityTest.php b/tests/Event/EventCommentEntityTest.php
index f3f012ed5..fafa78068 100644
--- a/tests/Event/EventCommentEntityTest.php
+++ b/tests/Event/EventCommentEntityTest.php
@@ -1,7 +1,7 @@
commentData = new stdClass();
+ $this->commentData = new stdClass();
$this->commentData->comment = "Test event comment text";
$this->commentData->user_display_name = "Test comment display name";
$this->commentData->created_date = "2014-03-02T08:43:44+01:00";
diff --git a/tests/Event/EventEntityTest.php b/tests/Event/EventEntityTest.php
index 75c0001ad..6390f8c0f 100644
--- a/tests/Event/EventEntityTest.php
+++ b/tests/Event/EventEntityTest.php
@@ -1,7 +1,7 @@
eventData = new stdClass();
- $this->eventData->name = "Test event name";
- $this->eventData->icon = "Test event icon";
- $this->eventData->start_date = "Test event start date";
- $this->eventData->end_date = "Test event end date";
- $this->eventData->location = "Test event location";
- $this->eventData->description = "Test event description";
- $this->eventData->tags = "Test event tags";
- $this->eventData->latitude = "Test event latitude";
- $this->eventData->longitude = "Test event longitude";
- $this->eventData->href = "Test event href";
- $this->eventData->attendee_count = "Test event attendee count";
- $this->eventData->event_comments_count = "Test event event comments count";
- $this->eventData->comments_uri = "Test event comments uri";
- $this->eventData->talks_uri = "Test event talks uri";
- $this->eventData->uri = "Test event uri";
- $this->eventData->verbose_uri = "Test event verbose uri";
- $this->eventData->attending = "Test event attending";
- $this->eventData->attending_uri = "Test event attending uri";
- $this->eventData->stub = "Test event stub";
- $this->eventData->url_friendly_name = "Test event url friendly name";
- $this->eventData->comments_enabled = "1";
+ $this->eventData = new stdClass();
+ $this->eventData->name = "Test event name";
+ $this->eventData->icon = "Test event icon";
+ $this->eventData->start_date = "Test event start date";
+ $this->eventData->end_date = "Test event end date";
+ $this->eventData->location = "Test event location";
+ $this->eventData->description = "Test event description";
+ $this->eventData->tags = "Test event tags";
+ $this->eventData->latitude = "Test event latitude";
+ $this->eventData->longitude = "Test event longitude";
+ $this->eventData->href = "Test event href";
+ $this->eventData->attendee_count = "Test event attendee count";
+ $this->eventData->event_comments_count = "Test event event comments count";
+ $this->eventData->comments_uri = "Test event comments uri";
+ $this->eventData->talks_uri = "Test event talks uri";
+ $this->eventData->uri = "Test event uri";
+ $this->eventData->verbose_uri = "Test event verbose uri";
+ $this->eventData->attending = "Test event attending";
+ $this->eventData->attending_uri = "Test event attending uri";
+ $this->eventData->stub = "Test event stub";
+ $this->eventData->url_friendly_name = "Test event url friendly name";
+ $this->eventData->comments_enabled = "1";
$this->eventData->all_talk_comments_uri = "Test event all talk comments uri";
}
diff --git a/tests/Event/EventFormTypeTest.php b/tests/Event/EventFormTypeTest.php
new file mode 100644
index 000000000..a71764c92
--- /dev/null
+++ b/tests/Event/EventFormTypeTest.php
@@ -0,0 +1,85 @@
+validator = $this->createMock(ValidatorInterface::class);
+ $this->validator
+ ->method('validate')
+ ->will($this->returnValue(new ConstraintViolationList()));
+ $this->validator
+ ->method('getMetadataFor')
+ ->will($this->returnValue(new ClassMetadata(Form::class)));
+
+ return [
+ new ValidatorExtension($this->validator),
+ ];
+ }
+
+ public function testSubmitValidData()
+ {
+ $formResultData = [
+ "name" => "Community Conference",
+ "description" => "Conference description.",
+ "tags" => ["php", "conference", "web"],
+ "tz_continent" => "Europe",
+ "tz_place" => "Amsterdam",
+ "start_date" => "2019-01-01",
+ "end_date" => "2019-01-02",
+ "href" => "https://example.com/2019",
+ "cfp_start_date" => "2019-01-03",
+ "cfp_end_date" => "2019-01-01",
+ "cfp_url" => "https://example.com/cfp",
+ "location" => "Location",
+ "latitude" => "52.3546273",
+ "longitude" => "4.8284121",
+ "new_icon" => null
+ ];
+
+ $submittedFormData = [
+ "name" => "Community Conference",
+ "description" => "Conference description.",
+ "tags" => "php, conference, web",
+ "tz_continent" => "Europe",
+ "tz_place" => "Amsterdam",
+ "start_date" => "2019-01-01",
+ "end_date" => "2019-01-02",
+ "href" => "https://example.com/2019",
+ "cfp_start_date" => "2019-01-03",
+ "cfp_end_date" => "2019-01-01",
+ "cfp_url" => "https://example.com/cfp",
+ "location" => "Location",
+ "latitude" => "52.3546273",
+ "longitude" => "4.8284121",
+ "new_icon" => null
+ ];
+
+ $form = $this->factory->create(EventFormType::class);
+
+ $form->submit($submittedFormData);
+
+ $this->assertTrue($form->isSynchronized());
+
+ $this->assertEquals($formResultData, $form->getData());
+
+ $view = $form->createView();
+ $children = $view->children;
+
+ foreach (array_keys($formResultData) as $key) {
+ $this->assertArrayHasKey($key, $children);
+ }
+ }
+}
diff --git a/tests/Middleware/FormMiddlewareTest.php b/tests/Middleware/FormMiddlewareTest.php
new file mode 100644
index 000000000..06c184fbe
--- /dev/null
+++ b/tests/Middleware/FormMiddlewareTest.php
@@ -0,0 +1,37 @@
+createMock(Slim::class);
+
+ $validator = $this->createMock(ValidatorInterface::class);
+ $app->validator = $validator;
+
+ $translator = $this->getMockBuilder(Translator::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $app->translator = $translator;
+
+ $formMiddleware->setApplication($app);
+
+ $formFactory = $formMiddleware->createFormFactory();
+
+ $this->assertInstanceOf(FormFactoryInterface::class, $formFactory);
+ }
+}
diff --git a/tests/Middleware/ValidationMiddlewareTest.php b/tests/Middleware/ValidationMiddlewareTest.php
new file mode 100644
index 000000000..2b4de9e99
--- /dev/null
+++ b/tests/Middleware/ValidationMiddlewareTest.php
@@ -0,0 +1,27 @@
+setApplication($app);
+
+ $validator = $validationMiddleware->createValidator();
+
+ $this->assertInstanceOf(ValidatorInterface::class, $validator);
+ }
+}
diff --git a/tests/Talk/TalkCommentEntityTest.php b/tests/Talk/TalkCommentEntityTest.php
index 9ccbf6f31..dbb12f632 100644
--- a/tests/Talk/TalkCommentEntityTest.php
+++ b/tests/Talk/TalkCommentEntityTest.php
@@ -1,8 +1,8 @@
commentData = new stdClass();
- $this->commentData->rating = 5;
- $this->commentData->comment = "Test event comment text";
- $this->commentData->user_display_name = "Test comment display name";
- $this->commentData->talk_title = "Test talk title";
- $this->commentData->created_date = "2014-03-02T08:43:44+01:00";
- $this->commentData->uri = "Test comment uri";
- $this->commentData->verbose_uri = "Test comment verbose uri";
- $this->commentData->talk_uri = "Test talk uri";
- $this->commentData->talk_comments_uri = "Test comments uri";
- $this->commentData->user_uri = "Test user uri";
- $this->commentData->source = "Test comment source";
+ $this->commentData = new stdClass();
+ $this->commentData->rating = 5;
+ $this->commentData->comment = "Test event comment text";
+ $this->commentData->user_display_name = "Test comment display name";
+ $this->commentData->talk_title = "Test talk title";
+ $this->commentData->created_date = "2014-03-02T08:43:44+01:00";
+ $this->commentData->uri = "Test comment uri";
+ $this->commentData->verbose_uri = "Test comment verbose uri";
+ $this->commentData->talk_uri = "Test talk uri";
+ $this->commentData->talk_comments_uri = "Test comments uri";
+ $this->commentData->user_uri = "Test user uri";
+ $this->commentData->source = "Test comment source";
}
public function testBasicCommentsData(): void
diff --git a/tests/View/TwigExtensionIntegrationTest.php b/tests/View/TwigExtensionIntegrationTest.php
index 5fd129efe..bf2e988cc 100644
--- a/tests/View/TwigExtensionIntegrationTest.php
+++ b/tests/View/TwigExtensionIntegrationTest.php
@@ -1,11 +1,12 @@
new \Slim\Views\Twig(),
+ 'view' => new Slim\Views\Twig(),
]
)
);
@@ -52,20 +53,18 @@
);
// Other variables needed by the main layout.html.twig template
-$app->view()->appendData(
- [
- 'google_analytics_id' => $config['slim']['custom']['googleAnalyticsId'],
- 'user' => (isset($_SESSION['user']) ? $_SESSION['user'] : false),
- ]
-);
+$app->view()->appendData([
+ 'google_analytics_id' => $config['slim']['custom']['googleAnalyticsId'],
+ 'user' => (isset($_SESSION['user']) ? $_SESSION['user'] : false),
+]);
// set Twig base folder, view folder and initialize Joindin filters
$app->view()->parserDirectory = realpath(__DIR__ . '/../vendor/Twig/lib/Twig');
$app->view()->setTemplatesDirectory('../app/templates');
-$app->view()->getEnvironment()->addExtension(new \View\FiltersExtension());
-$app->view()->getEnvironment()->addExtension(new \Slim\Views\TwigExtension());
-$app->view()->getEnvironment()->addExtension(new \View\FunctionsExtension($app));
+$app->view()->getEnvironment()->addExtension(new JoindIn\Web\View\FiltersExtension());
+$app->view()->getEnvironment()->addExtension(new Slim\Views\TwigExtension());
+$app->view()->getEnvironment()->addExtension(new JoindIn\Web\View\FunctionsExtension($app));
if (isset($config['slim']['twig']['cache'])) {
$app->view()->getEnvironment()->setCache($config['slim']['twig']['cache']);
@@ -76,11 +75,11 @@
$app->configureMode('development', function () use ($app) {
$env = $app->view()->getEnvironment();
$env->enableDebug();
- $env->addExtension(new \Twig_Extension_Debug());
+ $env->addExtension(new Twig_Extension_Debug());
});
// register error handlers
-$app->error(function (\Exception $e) use ($app) {
+$app->error(function (Exception $e) use ($app) {
error_log(get_class($e) . ': ' . $e->getMessage() . " -- " . $e->getTraceAsString());
$app->render('Error/error.html.twig', ['exception' => $e]);
});
@@ -90,19 +89,18 @@
});
// register middlewares
-$app->add(new Middleware\ValidationMiddleware());
+$app->add(new JoindIn\Web\Middleware\ValidationMiddleware());
$csrfSecret = null;
if (!empty($config['slim']['custom']['csrfSecret'])) {
$csrfSecret = $config['slim']['custom']['csrfSecret'];
}
-$app->add(new Middleware\FormMiddleware($csrfSecret));
+$app->add(new JoindIn\Web\Middleware\FormMiddleware($csrfSecret));
// register services
$app->container->set('access_token', isset($_SESSION['access_token']) ? $_SESSION['access_token'] : null);
-$app->container->singleton(\Application\CacheService::class, function ($container) {
-
+$app->container->singleton(JoindIn\Web\Application\CacheService::class, function ($container) {
$redis = $container->settings['custom']['redis'];
$prefix = $redis['options']['prefix'];
@@ -111,67 +109,67 @@
}
$client = new Predis\Client($redis['connection']);
- return new \Application\CacheService($client, $prefix);
+ return new JoindIn\Web\Application\CacheService($client, $prefix);
});
-$app->container->singleton(\Application\ContactApi::class, function ($container) {
- return new \Application\ContactApi($container['settings']['custom'], $container['access_token']);
+$app->container->singleton(JoindIn\Web\Application\ContactApi::class, function ($container) {
+ return new JoindIn\Web\Application\ContactApi($container['settings']['custom'], $container['access_token']);
});
-$app->container->singleton(\User\UserDb::class, function ($container) {
- return new \User\UserDb($container[\Application\CacheService::class]);
+$app->container->singleton(JoindIn\Web\User\UserDb::class, function ($container) {
+ return new JoindIn\Web\User\UserDb($container[JoindIn\Web\Application\CacheService::class]);
});
-$app->container->singleton(\User\UserApi::class, function ($container) {
- return new \User\UserApi(
+$app->container->singleton(JoindIn\Web\User\UserApi::class, function ($container) {
+ return new JoindIn\Web\User\UserApi(
$container['settings']['custom'],
$container['access_token'],
- $container[\User\UserDb::class]
+ $container[JoindIn\Web\User\UserDb::class]
);
});
-$app->container->singleton(\Event\EventDb::class, function ($container) {
- return new \Event\EventDb($container[\Application\CacheService::class]);
+$app->container->singleton(JoindIn\Web\Event\EventDb::class, function ($container) {
+ return new JoindIn\Web\Event\EventDb($container[JoindIn\Web\Application\CacheService::class]);
});
-$app->container->singleton(\Event\EventApi::class, function ($container) {
- return new \Event\EventApi(
+$app->container->singleton(JoindIn\Web\Event\EventApi::class, function ($container) {
+ return new JoindIn\Web\Event\EventApi(
$container['settings']['custom'],
$container['access_token'],
- $container[\Event\EventDb::class],
- $container[\User\UserApi::class]
+ $container[JoindIn\Web\Event\EventDb::class],
+ $container[JoindIn\Web\User\UserApi::class]
);
});
-$app->container->singleton(\Talk\TalkDb::class, function ($container) {
- return new \Talk\TalkDb($container[\Application\CacheService::class]);
+$app->container->singleton(JoindIn\Web\Talk\TalkDb::class, function ($container) {
+ return new JoindIn\Web\Talk\TalkDb($container[JoindIn\Web\Application\CacheService::class]);
});
-$app->container->singleton(\Talk\TalkApi::class, function ($container) {
- return new \Talk\TalkApi(
+$app->container->singleton(JoindIn\Web\Talk\TalkApi::class, function ($container) {
+ return new JoindIn\Web\Talk\TalkApi(
$container['settings']['custom'],
$container['access_token'],
- new \Talk\TalkDb($container[\Application\CacheService::class]),
- $container[\User\UserApi::class]
+ new JoindIn\Web\Talk\TalkDb($container[JoindIn\Web\Application\CacheService::class]),
+ $container[JoindIn\Web\User\UserApi::class]
);
});
-$app->container->singleton(\User\AuthApi::class, function ($container) {
- return new \User\AuthApi($container['settings']['custom'], $container['access_token']);
+$app->container->singleton(JoindIn\Web\User\AuthApi::class, function ($container) {
+ return new JoindIn\Web\User\AuthApi($container['settings']['custom'], $container['access_token']);
});
-$app->container->singleton(\Language\LanguageApi::class, function ($container) {
- return new \Language\LanguageApi($container['settings']['custom'], $container['access_token']);
+$app->container->singleton(JoindIn\Web\Language\LanguageApi::class, function ($container) {
+ return new JoindIn\Web\Language\LanguageApi($container['settings']['custom'], $container['access_token']);
});
-$app->container->singleton(\Talk\TalkTypeApi::class, function ($container) {
- return new \Talk\TalkTypeApi($container['settings']['custom'], $container['access_token']);
+$app->container->singleton(JoindIn\Web\Talk\TalkTypeApi::class, function ($container) {
+ return new JoindIn\Web\Talk\TalkTypeApi($container['settings']['custom'], $container['access_token']);
});
-$app->container->singleton(\Event\TrackApi::class, function ($container) {
- return new \Event\TrackApi($container['settings']['custom'], $container['access_token']);
+$app->container->singleton(JoindIn\Web\Event\TrackApi::class, function ($container) {
+ return new JoindIn\Web\Event\TrackApi($container['settings']['custom'], $container['access_token']);
});
-$app->container->singleton(\Client\ClientApi::class, function ($container) {
- return new \Client\ClientApi($container['settings']['custom'], $container['access_token']);
+$app->container->singleton(JoindIn\Web\Client\ClientApi::class, function ($container) {
+ return new JoindIn\Web\Client\ClientApi($container['settings']['custom'], $container['access_token']);
});
// register routes
-new Application\ApplicationController($app);
-new Event\EventController($app);
-new Search\SearchController($app);
-new User\UserController($app);
-new Talk\TalkController($app);
-new Client\ClientController($app);
-new Apikey\ApikeyController($app);
+new JoindIn\Web\Application\ApplicationController($app);
+new JoindIn\Web\Event\EventController($app);
+new JoindIn\Web\Search\SearchController($app);
+new JoindIn\Web\User\UserController($app);
+new JoindIn\Web\Talk\TalkController($app);
+new JoindIn\Web\Client\ClientController($app);
+new JoindIn\Web\Apikey\ApikeyController($app);
// execute application
$app->run();