Skip to content

Commit

Permalink
Use PHP5 style constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Berdir committed Nov 28, 2017
1 parent 8a3b5a6 commit f4763e3
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion GLExchange/GLExchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class GLExchange {
* $connectionConfig
* PDConfig - Project Director Connection Configuration
*/
function GLExchange($connectionConfig) {
function __construct($connectionConfig) {
$this->_setConnectionConfig ( $connectionConfig );
}

Expand Down
4 changes: 2 additions & 2 deletions GLExchange/model/CustomAttribute.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PDCustomAttribute {
* Attribute value
*/
public $values;
function PDCustomAttribute($customAttribute = NULL) {
function __construct($customAttribute = NULL) {
if (isset ( $customAttribute )) {
$this->mandatory = $customAttribute->mandatory;
$this->name = $customAttribute->name;
Expand All @@ -25,4 +25,4 @@ function PDCustomAttribute($customAttribute = NULL) {
}
}
}
?>
?>
4 changes: 2 additions & 2 deletions GLExchange/model/Document.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PDDocument {
* [Optional] Key-value array of additional metadata that you may want to attach to your document
*/
public $metadata;
public function getDocumentInfo($submission) {
public function __construct($submission) {
$documentInfo = new DocumentInfo ();
$documentInfo->projectTicket = $submission->project->ticket;
$documentInfo->name = $this->name;
Expand Down Expand Up @@ -126,4 +126,4 @@ public function getResourceInfo() {
}
}

?>
?>
4 changes: 2 additions & 2 deletions GLExchange/model/LanguageDirection.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class PDLanguageDirection {
public $sourceLanguageName;
public $targetLanguage;
public $targetLanguageName;
function PDLanguageDirection($externalLanguageDirection){
function __construct($externalLanguageDirection){
$this->sourceLanguage = $externalLanguageDirection->sourceLanguage->locale;
$this->sourceLanguageName = $externalLanguageDirection->sourceLanguage->value;
$this->targetLanguage = $externalLanguageDirection->targetLanguage->locale;
Expand All @@ -14,4 +14,4 @@ function PDLanguageDirection($externalLanguageDirection){

}

?>
?>
4 changes: 2 additions & 2 deletions GLExchange/model/Project.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PDProject {
* List of custom attributes configured for this project. Array of PDCustomAttribute
*/
public $customAttributes = array ();
function PDProject($externalProject) {
function __construct($externalProject) {
$this->name = $externalProject->projectInfo->name;
$this->shortcode = $externalProject->projectInfo->shortCode;
$this->ticket = $externalProject->ticket;
Expand Down Expand Up @@ -77,4 +77,4 @@ function PDProject($externalProject) {
}
}

?>
?>
4 changes: 2 additions & 2 deletions GLExchange/model/Target.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PDTarget {
* PDWordCount of target
*/
public $wordCount;
function PDTarget($externalTarget) {
function __construct($externalTarget) {
$this->documentName = $externalTarget->document->documentInfo->name;
$this->sourceLocale = $externalTarget->sourceLanguage->locale;
$this->targetLocale = $externalTarget->targetLanguage->locale;
Expand All @@ -54,4 +54,4 @@ function PDTarget($externalTarget) {
}
}

?>
?>
4 changes: 2 additions & 2 deletions GLExchange/model/WordCount.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ class WordCount {
public $repetitions; // int
public $nomatch; // int
public $total; // int
function WordCount($_golden, $_exact_100, $_repetitions, $_nomatch, $_total) {
function __construct($_golden, $_exact_100, $_repetitions, $_nomatch, $_total) {
$this->golden = $_golden;
$this->exact_100 = $_exact_100;
$this->fuzzy = $_total - $_golden - $_exact_100 - $_repetitions - $_nomatch;
$this->repetitions = $_repetitions;
$this->nomatch = $_nomatch;
$this->total = $_total;
}
}
}
4 changes: 2 additions & 2 deletions GLExchange/model/Workflow.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class PDWorkflow {
* Workflow ticket
*/
public $ticket;
function PDWorkflow($externalWorkflow) {
function __construct($externalWorkflow) {
$this->name = $externalWorkflow->name;
$this->ticket = $externalWorkflow->ticket;
}
}
}

0 comments on commit f4763e3

Please sign in to comment.