Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Generate Methods in PHP class(Automatically generate some Methods in PHP Class)
Generate Methods in PHP class [message #1837757] Fri, 05 February 2021 15:06 Go to next message
Markus Kiesel is currently offline Markus KieselFriend
Messages: 2
Registered: February 2021
Junior Member
Hey,

maybe I missed this feature when checking the settings.
But I wrote a new class, added some fields and wanted to generate the constructor for this class (and also the toString method).

The only thing I could generate were the getters and setters. When clicking on "Source" -> "Override/Implement Methods..." I get the info popup "No methods to override found for this type".

Am I doing something wrong?

Here is my example class:
<?php
class TestClass {
    /**
     * @var string
     */
    private $name;
    
    /**
     * @var string
     */
    private $password;

}

Best regards
Markus
Re: Generate Methods in PHP class [message #1837814 is a reply to message #1837757] Mon, 08 February 2021 07:21 Go to previous messageGo to next message
Piotr Budek is currently offline Piotr BudekFriend
Messages: 2
Registered: July 2020
Junior Member
Your TestClass doesn't implement any interface nor extends any class,
so Eclipse doesn't know what you wanna implement in the class.
index.php/fa/39964/0/
Re: Generate Methods in PHP class [message #1837815 is a reply to message #1837757] Mon, 08 February 2021 07:35 Go to previous message
Markus Kiesel is currently offline Markus KieselFriend
Messages: 2
Registered: February 2021
Junior Member
Okay, for extending and implementing classes it is working.
But my expection was, that the constructor can be automatically generated:

public function __construct($name, $password) {
$this->name = $name;
$this->password = $password;
}
Previous Topic:Eclipse PHP Tools and Existing Development Site
Next Topic:Eclipse - problem with two runing php web applications from two different projects
Goto Forum:
  


Current Time: Sun Apr 18 07:25:04 GMT 2021

Powered by FUDForum. Page generated in 0.01979 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top