Selaa lähdekoodia

Coding standards.

xaav 14 vuotta sitten
vanhempi
commit
fae75e0909

+ 1 - 1
src/Packagist/WebBundle/Controller/WebController.php

@@ -124,7 +124,7 @@ class WebController extends Controller
             ->getRepository('PackagistWebBundle:Package')
             ->findOneById($id);
 
-        if(empty($package))  {
+        if (empty($package)) {
             throw new NotFoundHttpException();
         }
 

+ 2 - 2
src/Packagist/WebBundle/Resources/views/Web/index.html.twig

@@ -5,7 +5,7 @@
     {% for package in packages %}
         <section class="package">
             <h2><a href="{{ url('view', { 'id' : package.id }) }}">{{ package.name }}</a></h2>
-            {% if package.versions[0] is defined %}
+            {% if package.versions is not empty %}
                 <p class="description">{{ package.versions[0].description }}</p>
                 <p class="license">License: {{ package.versions[0].license|default("Unknown") }}</p>
                 <p class="links">
@@ -18,7 +18,7 @@
                 {% for maintainer in package.maintainers %}
                     {{ maintainer.username }}{{ loop.last ? '' : ', ' }}
                 {% endfor %}</p>
-            {% elseif package.crawledAt == null %}
+            {% elseif package.crawledAt is null %}
                 This package has not been crawled yet, some information is missing.
             {% else %}
                 This package has no released version yet, and little information is available yet.

+ 2 - 2
src/Packagist/WebBundle/Resources/views/Web/view.html.twig

@@ -2,7 +2,7 @@
 
 {% block content %}
     <h1>Viewing package {{ package.name }}</h1>
-    {% if package.versions[0] is defined %}
+    {% if package.versions is not empty %}
         {% for version in package.versions %}
             <h2>Version {{ version.version }}</h2>
 	        <p class="description">{{ version.description }}</p>
@@ -18,7 +18,7 @@
         {% for maintainer in package.maintainers %}
             {{ maintainer.username }}{{ loop.last ? '' : ', ' }}
         {% endfor %}</p>
-    {% elseif package.crawledAt == null %}
+    {% elseif package.crawledAt is null %}
         This package has not been crawled yet, some information is missing.
     {% else %}
         This package has no released version yet, and little information is available yet.