Permalink
Browse files

Instead of validating author, always create author JSON

  • Loading branch information...
1 parent e41415e commit 006ca49eb6d353c91d16866823cf581fd0f5050a @VSEphpbb VSEphpbb committed Apr 27, 2016
Showing with 6 additions and 20 deletions.
  1. +6 −9 helper/packager.php
  2. +0 −10 helper/validator.php
  3. +0 −1 language/en/common.php
View
15 helper/packager.php
@@ -248,15 +248,12 @@ public function get_composer_json_from_data($data)
foreach ($data['authors'] as $i => $author_data)
{
- if ($data['authors'][$i]['author_name'] !== '')
- {
- $composer['authors'][] = array(
- 'name' => "{$data['authors'][$i]['author_name']}",
- 'email' => "{$data['authors'][$i]['author_email']}",
- 'homepage' => "{$data['authors'][$i]['author_homepage']}",
- 'role' => "{$data['authors'][$i]['author_role']}",
- );
- }
+ $composer['authors'][] = array(
+ 'name' => "{$data['authors'][$i]['author_name']}",
+ 'email' => "{$data['authors'][$i]['author_email']}",
+ 'homepage' => "{$data['authors'][$i]['author_homepage']}",
+ 'role' => "{$data['authors'][$i]['author_role']}",
+ );
}
$body = json_encode($composer, JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES);
View
10 helper/validator.php
@@ -25,16 +25,6 @@ public function __construct(user $user)
$this->user = $user;
}
- public function validate_author_name($value)
- {
- if (strlen($value))
- {
- return $value;
- }
-
- throw new \RuntimeException($this->user->lang('SKELETON_INVALID_AUTHOR_NAME'));
- }
-
public function validate_num_authors($value)
{
if (preg_match('#^\d+$#', $value) && $value > 0 && $value <= 20)
View
1 language/en/common.php
@@ -108,7 +108,6 @@
'SKELETON_TITLE_REQUIREMENT_INFO' => 'Requirements',
'SKELETON_TITLE_COMPONENT_INFO' => 'Components',
- 'SKELETON_INVALID_AUTHOR_NAME' => 'The author name is required',
'SKELETON_INVALID_EXTENSION_NAME' => 'The extension name you provided is invalid',
'SKELETON_INVALID_EXTENSION_TIME' => 'The extension date you provided is invalid',
'SKELETON_INVALID_EXTENSION_VERSION'=> 'The extension version you provided is invalid',

0 comments on commit 006ca49

Please sign in to comment.