[Rt-commit] rtfm branch, 2.4/perlcritic, updated. 2.4.3-11-g617fd32

Alex Vandiver alexmv at bestpractical.com
Tue Jul 5 13:53:15 EDT 2011


The branch, 2.4/perlcritic has been updated
       via  617fd323283f90dc76301d1140f87df12627cd1c (commit)
      from  6b0f30ca2604f378a87b9ff1d893d7eaf5d35268 (commit)

Summary of changes:
 html/Admin/RTFM/Classes/Modify.html   |    2 +-
 html/Admin/RTFM/Classes/Topics.html   |    2 +-
 html/Admin/RTFM/Classes/index.html    |    2 +-
 html/Admin/RTFM/Elements/Topics       |    2 +-
 html/RTFM/Article/Edit.html           |    2 +-
 html/RTFM/Article/Elements/EditTopics |   10 +++++-----
 html/RTFM/Article/Elements/ShowTopics |    2 +-
 html/RTFM/Article/Search.html         |    2 +-
 html/RTFM/Elements/NewestArticles     |    2 +-
 html/RTFM/Elements/SelectClass        |    4 ++--
 html/RTFM/Elements/UpdatedArticles    |    2 +-
 lib/RT/FM/Article_Overlay.pm          |    8 ++++----
 lib/RT/FM/Topic_Overlay.pm            |    6 +++---
 t/05cfsearch.t                        |    8 ++++----
 t/2basic_api.t                        |    2 +-
 15 files changed, 28 insertions(+), 28 deletions(-)

- Log -----------------------------------------------------------------
commit 617fd323283f90dc76301d1140f87df12627cd1c
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Jul 5 13:52:54 2011 -0400

    Remove indirect object notation

diff --git a/html/Admin/RTFM/Classes/Modify.html b/html/Admin/RTFM/Classes/Modify.html
index e3115f1..3108bd5 100644
--- a/html/Admin/RTFM/Classes/Modify.html
+++ b/html/Admin/RTFM/Classes/Modify.html
@@ -94,7 +94,7 @@ $current_subtab, Title => $title &>
 
 <%INIT>
 
-my $ClassObj = new RT::FM::Class($session{'CurrentUser'});
+my $ClassObj = RT::FM::Class->new($session{'CurrentUser'});
 my  ($title, @results, $Disabled);
 
 if ($Create) {
diff --git a/html/Admin/RTFM/Classes/Topics.html b/html/Admin/RTFM/Classes/Topics.html
index a0e372e..97c9583 100644
--- a/html/Admin/RTFM/Classes/Topics.html
+++ b/html/Admin/RTFM/Classes/Topics.html
@@ -50,7 +50,7 @@
 
 <%INIT>
 
-my $ClassObj = new RT::FM::Class($session{'CurrentUser'});
+my $ClassObj = RT::FM::Class->new($session{'CurrentUser'});
 $ClassObj->Load($ARGS{'id'}) || $m->comp("/RTFM/Elements/Error", Why => "Couldn't load class '$id'");
 
 my $title = $Modify 
diff --git a/html/Admin/RTFM/Classes/index.html b/html/Admin/RTFM/Classes/index.html
index e514f27..a8fc5c9 100644
--- a/html/Admin/RTFM/Classes/index.html
+++ b/html/Admin/RTFM/Classes/index.html
@@ -74,7 +74,7 @@
 </table>
 <%INIT>
 my $caption;
-my $Classes = new RT::FM::ClassCollection($session{'CurrentUser'});
+my $Classes = RT::FM::ClassCollection->new($session{'CurrentUser'});
 my @allowed_classes;
 
 if ($FindDisabledClasses) {
diff --git a/html/Admin/RTFM/Elements/Topics b/html/Admin/RTFM/Elements/Topics
index bc68f1d..7a26da1 100644
--- a/html/Admin/RTFM/Elements/Topics
+++ b/html/Admin/RTFM/Elements/Topics
@@ -169,7 +169,7 @@ for my $k (keys %ARGS) {
     }
 }
 
-my $topics = new RT::FM::TopicCollection($session{'CurrentUser'});
+my $topics = RT::FM::TopicCollection->new($session{'CurrentUser'});
 $topics->LimitToObject($RootObj);
 $topics->OrderByCols({FIELD => 'Parent'}, {FIELD => 'id'});
 
diff --git a/html/RTFM/Article/Edit.html b/html/RTFM/Article/Edit.html
index 50b4294..59b58ea 100644
--- a/html/RTFM/Article/Edit.html
+++ b/html/RTFM/Article/Edit.html
@@ -297,7 +297,7 @@ else {
     if ( $ARGS{'EditTopics'} ) {
         $topics{$_}++ for @{ $ARGS{'Topics'} };
         my $objTopics =
-          new RT::FM::ObjectTopicCollection( $session{'CurrentUser'} );
+          RT::FM::ObjectTopicCollection->new( $session{'CurrentUser'} );
         $objTopics->LimitToObject($ArticleObj);
         while ( my $t = $objTopics->Next ) {
             $topics{ $t->Topic }--;
diff --git a/html/RTFM/Article/Elements/EditTopics b/html/RTFM/Article/Elements/EditTopics
index e28f348..115237a 100644
--- a/html/RTFM/Article/Elements/EditTopics
+++ b/html/RTFM/Article/Elements/EditTopics
@@ -66,7 +66,7 @@ unless ($OnlyThisClass) {
     unless ($topic->ObjectId == $class) {
       $class = $topic->ObjectId;
       $m->print("</optgroup>\n");
-      my $c = new RT::FM::Class($session{'CurrentUser'});
+      my $c = RT::FM::Class->new($session{'CurrentUser'});
       $c->Load($topic->ObjectId);
       $m->print("<optgroup label=\"".$c->Name."\">\n");
     }
@@ -82,14 +82,14 @@ unless ($OnlyThisClass) {
 <%INIT>
 use Tree::Simple;
 
-my $inClass = new RT::FM::TopicCollection($session{'CurrentUser'});
+my $inClass = RT::FM::TopicCollection->new($session{'CurrentUser'});
 # global topics should always be available
 push @Classes,$RT::FM::System unless grep { $_ == $RT::FM::System } @Classes;
 $inClass->LimitToObject($_) for @Classes;
 $inClass->OrderByCols({FIELD => 'Name'});
 my $inTree = buildTree($inClass);
 
-my $otherClass = new RT::FM::TopicCollection($session{'CurrentUser'});
+my $otherClass = RT::FM::TopicCollection->new($session{'CurrentUser'});
 if (@Classes) {
   $otherClass->Limit(FIELD => 'ObjectType', VALUE => 'RT::FM::Class');
   for (@Classes) {
@@ -100,7 +100,7 @@ if (@Classes) {
 }
 my $otherTree = buildTree($otherClass);
 
-my $articleTopics = new RT::FM::ObjectTopicCollection($session{'CurrentUser'});
+my $articleTopics = RT::FM::ObjectTopicCollection->new($session{'CurrentUser'});
 $articleTopics->LimitToObject($ArticleObj);
 my %topics;
 while (my $topicObj = $articleTopics->Next) {
@@ -139,7 +139,7 @@ sub buildTree {
 
 </%INIT>
 <%ARGS>
-$ArticleObj => new RT::FM::Article($session{'CurrentUser'})
+$ArticleObj => RT::FM::Article->new($session{'CurrentUser'})
 @Classes => ()
 @Topics => ()
 $OnlyThisClass => undef
diff --git a/html/RTFM/Article/Elements/ShowTopics b/html/RTFM/Article/Elements/ShowTopics
index e72808a..a7e4c58 100644
--- a/html/RTFM/Article/Elements/ShowTopics
+++ b/html/RTFM/Article/Elements/ShowTopics
@@ -44,7 +44,7 @@
 %# works based on those contributions, and sublicense and distribute
 %# those contributions and any derivatives thereof.
 %#%# END BPS TAGGED BLOCK }}}
-% my $topics = new RT::FM::ObjectTopicCollection($session{'CurrentUser'});
+% my $topics = RT::FM::ObjectTopicCollection->new($session{'CurrentUser'});
 % $topics->LimitToObject($article);
 % my @topics;
 % while (my $t = $topics->Next) {
diff --git a/html/RTFM/Article/Search.html b/html/RTFM/Article/Search.html
index 6640aa4..9a5cd9c 100644
--- a/html/RTFM/Article/Search.html
+++ b/html/RTFM/Article/Search.html
@@ -47,7 +47,7 @@
 <& /RTFM/Article/Elements/Tabs, current_tab => "RTFM/Article/Search.html", Title => loc("Search for articles") &>
 
 % unless ( keys %ARGS ) {
-%   my $Classes=new RT::FM::ClassCollection($session{'CurrentUser'});
+%   my $Classes=RT::FM::ClassCollection->new($session{'CurrentUser'});
 %   $Classes->LimitToEnabled();
 <table width="100%" border="0">
 <tr>
diff --git a/html/RTFM/Elements/NewestArticles b/html/RTFM/Elements/NewestArticles
index d2216c0..8bdb8dd 100644
--- a/html/RTFM/Elements/NewestArticles
+++ b/html/RTFM/Elements/NewestArticles
@@ -71,7 +71,7 @@
 my $rows = 10;
 my $i;
 my $MyArticles;
-$MyArticles = new RT::FM::ArticleCollection ($session{'CurrentUser'});
+$MyArticles = RT::FM::ArticleCollection->new($session{'CurrentUser'});
 $MyArticles->UnLimit;
 $MyArticles->RowsPerPage($rows);
 $MyArticles->OrderBy(FIELD => 'LastUpdated', ORDER => 'DESC');
diff --git a/html/RTFM/Elements/SelectClass b/html/RTFM/Elements/SelectClass
index dad9c9b..6e9aa4f 100644
--- a/html/RTFM/Elements/SelectClass
+++ b/html/RTFM/Elements/SelectClass
@@ -85,10 +85,10 @@ $Lite => 0
 
 my @Default = ref($Default) eq 'ARRAY' ? @$Default : ( $Default);
 
-my $Classes=new RT::FM::ClassCollection($session{'CurrentUser'});
+my $Classes=RT::FM::ClassCollection->new($session{'CurrentUser'});
 $Classes->LimitToEnabled();
 
-my $d = new RT::FM::Class($session{'CurrentUser'});
+my $d = RT::FM::Class->new($session{'CurrentUser'});
 $d->Load($Default[0]);
 
 </%INIT>
diff --git a/html/RTFM/Elements/UpdatedArticles b/html/RTFM/Elements/UpdatedArticles
index 1f77c93..180ab99 100644
--- a/html/RTFM/Elements/UpdatedArticles
+++ b/html/RTFM/Elements/UpdatedArticles
@@ -72,7 +72,7 @@
 my $rows = 10;
 my $i;
 my $MyArticles;
-$MyArticles = new RT::FM::ArticleCollection ($session{'CurrentUser'});
+$MyArticles = RT::FM::ArticleCollection->new($session{'CurrentUser'});
 $MyArticles->RowsPerPage($rows);
 $MyArticles->Limit(FIELD => 'Created', OPERATOR => '!=', VALUE => 'LastUpdated', QUOTEVALUE => 0 );
 $MyArticles->OrderBy(FIELD => 'Created', ORDER => 'DESC');
diff --git a/lib/RT/FM/Article_Overlay.pm b/lib/RT/FM/Article_Overlay.pm
index a7cc79d..e308434 100644
--- a/lib/RT/FM/Article_Overlay.pm
+++ b/lib/RT/FM/Article_Overlay.pm
@@ -334,7 +334,7 @@ routine will not recurse and will not find grandchildren, great-grandchildren, u
 
 sub Children {
     my $self = shift;
-    my $kids = new RT::FM::ArticleCollection( $self->CurrentUser );
+    my $kids = RT::FM::ArticleCollection->new( $self->CurrentUser );
 
     unless ( $self->CurrentUserHasRight('ShowArticle') ) {
         $kids->LimitToParent( $self->Id );
@@ -445,7 +445,7 @@ sub URIObj {
 sub Topics {
     my $self = shift;
 
-    my $topics = new RT::FM::ObjectTopicCollection( $self->CurrentUser );
+    my $topics = RT::FM::ObjectTopicCollection->new( $self->CurrentUser );
     if ( $self->CurrentUserHasRight('ShowArticle') ) {
         $topics->LimitToObject($self);
     }
@@ -463,7 +463,7 @@ sub AddTopic {
         return ( 0, $self->loc("Permission Denied") );
     }
 
-    my $t = new RT::FM::ObjectTopic( $self->CurrentUser );
+    my $t = RT::FM::ObjectTopic->new( $self->CurrentUser );
     my ($tid) = $t->Create(
         Topic      => $args{'Topic'},
         ObjectType => ref($self),
@@ -487,7 +487,7 @@ sub DeleteTopic {
         return ( 0, $self->loc("Permission Denied") );
     }
 
-    my $t = new RT::FM::ObjectTopic( $self->CurrentUser );
+    my $t = RT::FM::ObjectTopic->new( $self->CurrentUser );
     $t->LoadByCols(
         Topic      => $args{'Topic'},
         ObjectId   => $self->Id,
diff --git a/lib/RT/FM/Topic_Overlay.pm b/lib/RT/FM/Topic_Overlay.pm
index b80bd9c..4f20db7 100644
--- a/lib/RT/FM/Topic_Overlay.pm
+++ b/lib/RT/FM/Topic_Overlay.pm
@@ -109,7 +109,7 @@ sub Delete {
         return ( 0, $self->loc("Permission Denied") );
     }
 
-    my $kids = new RT::FM::TopicCollection($self->CurrentUser);
+    my $kids = RT::FM::TopicCollection->new($self->CurrentUser);
     $kids->LimitToKids($self->Id);
     while (my $topic = $kids->Next) {
         $topic->setParent($self->Parent);
@@ -138,7 +138,7 @@ sub DeleteAll {
     }
 
     $self->SUPER::Delete(@_);
-    my $kids = new RT::FM::TopicCollection($self->CurrentUser);
+    my $kids = RT::FM::TopicCollection->new($self->CurrentUser);
     $kids->LimitToKids($self->Id);
     while (my $topic = $kids->Next) {
         $topic->DeleteAll;
@@ -161,7 +161,7 @@ Returns the parent Topic of this one.
 sub ParentObj {
   my $self = shift;
   my $id = $self->Parent;
-  my $obj = new RT::FM::Topic($self->CurrentUser);
+  my $obj = RT::FM::Topic->new($self->CurrentUser);
   $obj->Load($id);
   return $obj;
 }
diff --git a/t/05cfsearch.t b/t/05cfsearch.t
index 3682f3c..8c1e719 100644
--- a/t/05cfsearch.t
+++ b/t/05cfsearch.t
@@ -59,12 +59,12 @@ my $cf = RT::CustomField->new( $RT::SystemUser );
 }
 
 my $article1name = 'TestArticle1'.$suffix;
-my $article1 = new RT::FM::Article($RT::SystemUser);
+my $article1 = RT::FM::Article->new($RT::SystemUser);
 $article1->Create( Name => $article1name, Summary => 'Test', Class => $class->Id);
 $article1->AddCustomFieldValue(Field => $cf->Id, Value => 'Value1');
 
 my $article2name = 'TestArticle2'.$suffix;
-my $article2 = new RT::FM::Article($RT::SystemUser);
+my $article2 = RT::FM::Article->new($RT::SystemUser);
 $article2->Create( Name => $article2name, Summary => 'Test', Class => $class->Id);
 $article2->AddCustomFieldValue(Field => $cf->Id, Value => 'Value2');
 
@@ -78,7 +78,7 @@ $article2->AddCustomFieldValue(Field => $cf->Id, Value => 'Value2');
 }
 
 {
-    my $articles = new RT::FM::ArticleCollection($RT::SystemUser);
+    my $articles = RT::FM::ArticleCollection->new($RT::SystemUser);
     $articles->UnLimit;
     $articles->Limit( FIELD => "Class", SUBCLAUSE => 'ClassMatch', VALUE => $class->Id);
     $articles->LimitCustomField( FIELD => $cf, VALUE => 'Value1' );    
@@ -86,7 +86,7 @@ $article2->AddCustomFieldValue(Field => $cf->Id, Value => 'Value2');
 }
 
 {
-    my $articles = new RT::FM::ArticleCollection($RT::SystemUser);
+    my $articles = RT::FM::ArticleCollection->new($RT::SystemUser);
     $articles->UnLimit( );
     $articles->Limit( FIELD => "Class", SUBCLAUSE => 'ClassMatch', VALUE => $class->Id);
     $articles->LimitCustomField( FIELD => $cf->Name, VALUE => 'Value1' );
diff --git a/t/2basic_api.t b/t/2basic_api.t
index ee9d442..3fc506d 100644
--- a/t/2basic_api.t
+++ b/t/2basic_api.t
@@ -7,7 +7,7 @@ use lib 't/lib';
 use RT::FM::Test tests => 43;
 
 use_ok 'RT::FM::System';
-my $sys = new RT::FM::System;
+my $sys = RT::FM::System->new;
 isa_ok $sys, 'RT::FM::System';
 is $sys->Id, 1;
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list